Method and system for updating model parameters based on federated learning

By calculating the correlation coefficient between the model to be trained and the aggregated model, updating the model parameters and training locally, the problem of model diversity and communication efficiency in federated learning is solved, and the update and efficient training of personalized models are achieved.

CN114676849BActive Publication Date: 2024-09-17ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210294785.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-24
Publication Date
2024-09-17
Estimated Expiration
2042-03-24

AI Technical Summary

Technical Problem

In the federated learning process, directly using the server's model to replace the local model cannot achieve personalized representation of enterprise data, resulting in reduced model diversity and high communication and transmission pressure, which affects training efficiency.

Method used

By calculating the correlation coefficient between the model to be trained and the aggregated model, the model parameters of the model to be trained are updated, the personalized layer is updated to the layer of the aggregated model, and training is performed locally, the personalized model layer is retained, and some layers are used Model upload to reduce communication volume.

Benefits of technology

It realizes the update of personalized models, improves model diversity and training efficiency, reduces the communication volume in the federated learning process, and improves the overall training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114676849B
    Figure CN114676849B
Patent Text Reader

Abstract

The present specification provides a method and system for updating model parameters based on federated learning, wherein the method is implemented by any training member device among the participants, wherein the participants include multiple training member devices and a server, and the method includes performing multiple rounds of iterative updates on the model parameters, wherein one round of iterative updates includes: obtaining the current round of the model to be trained of the training member device and the current round of the aggregate model issued by the server; calculating the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregate model; determining a first correlation coefficient and a second correlation coefficient from the correlation coefficients; updating the model parameters of the model to be trained corresponding to the first correlation coefficient to the model parameters of the aggregate model corresponding to the first correlation coefficient, and keeping the model parameters of the model to be trained corresponding to the second correlation coefficient unchanged; and training the updated model to be trained based on the training samples held by the training member device itself.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and more particularly to a method for updating model parameters based on federated learning. The present invention also relates to a system for updating model parameters based on federated learning, a computing device, and a computer-readable storage medium. Background Art

[0002] With the development of artificial intelligence technology, deep neural network models (DNN) have gradually been applied to risk assessment, speech recognition, natural language processing and other fields. However, since the DNN network structure in different application scenarios is relatively fixed, in order to achieve better model performance, federated learning is usually used to optimize the DNN model. The federated learning optimizes the same type of DNN model based on the data of multiple enterprises through a third-party platform, thereby improving the accuracy of the DNN model, and can prevent information leakage and ensure the user privacy and business secrets of enterprises and institutions.

[0003] However, in the process of federated learning, since the model of the third-party platform is directly used to replace the company's local model, it is impossible to achieve personalized representation of the company's data, which makes it impossible for the company to obtain personalized models and reduces the diversity of the model. Summary of the invention

[0004] In view of this, the embodiments of this specification provide a method for updating model parameters based on federated learning. This specification also relates to a system for updating model parameters based on federated learning, a computing device, and a computer-readable storage medium to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, a method for updating model parameters based on federated learning is provided, wherein the method is implemented by any training member device among the participants, wherein the participants include multiple training member devices and a server,

[0006] The method comprises performing multiple rounds of iterative updates on the model parameters, wherein one round of iterative updates comprises:

[0007] Obtaining the current round of to-be-trained models of the training member devices and the current round of aggregated models sent by the server;

[0008] Calculating a correlation coefficient between model parameters corresponding to the model to be trained and the aggregated model, wherein the higher the correlation between the corresponding model parameters, the greater the correlation coefficient;

[0009] Determine a first correlation coefficient and a second correlation coefficient from the correlation coefficients, wherein the first correlation coefficient is greater than the second correlation coefficient;

[0010] Updating the model parameters of the model to be trained corresponding to the first correlation coefficient to the model parameters of the aggregation model corresponding to the first correlation coefficient, and keeping the model parameters of the model to be trained corresponding to the second correlation coefficient unchanged; and

[0011] The updated model to be trained is trained based on the training samples held by the training member device itself.

[0012] According to a second aspect of the embodiments of this specification, a system for updating model parameters based on federated learning is provided, wherein the system is placed at any training member device among the participants, wherein the participants include multiple training member devices and a server,

[0013] The system is used to perform multiple rounds of iterative updates on model parameters, and the system comprises:

[0014] A model acquisition module, used to acquire the to-be-trained model of the current round of the training member device and the aggregated model issued by the server in the current round;

[0015] A correlation coefficient calculation module, used to calculate the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregation model, wherein the higher the correlation between the corresponding model parameters, the greater the correlation coefficient;

[0016] A correlation coefficient determination module, used to determine a first correlation coefficient and a second correlation coefficient from the correlation coefficients, wherein the first correlation coefficient is greater than the second correlation coefficient;

[0017] a model updating module, configured to update the model parameters of the model to be trained corresponding to the first correlation coefficient to the model parameters of the aggregation model corresponding to the first correlation coefficient, and to keep the model parameters of the model to be trained corresponding to the second correlation coefficient unchanged; and

[0018] The model training module is used to train the updated model to be trained based on the training samples held by the training member device itself.

[0019] According to a third aspect of an embodiment of this specification, a computing device is provided, including:

[0020] Memory and processor;

[0021] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, any step of the method for updating model parameters based on federated learning is implemented.

[0022] According to a fourth aspect of an embodiment of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of any of the methods for updating model parameters based on federated learning are implemented.

[0023] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute any step of the method for updating model parameters based on federated learning.

[0024] The present specification provides a method for updating model parameters based on federated learning, which is implemented by any training member device among the participants, wherein the participants include multiple training member devices and a server, and the method includes performing multiple rounds of iterative updates on the model parameters, wherein one round of iterative updates includes: obtaining the current round of the model to be trained of the training member device and the aggregate model issued by the server in the current round; calculating the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregate model, wherein the higher the correlation between the corresponding model parameters, the larger the correlation coefficient; determining a first correlation coefficient and a second correlation coefficient from the correlation coefficients, wherein the first correlation coefficient is greater than the second correlation coefficient; updating the model parameters of the model to be trained corresponding to the first correlation coefficient to the model parameters of the aggregate model corresponding to the first correlation coefficient, and maintaining the model parameters of the model to be trained corresponding to the second correlation coefficient unchanged; and training the updated model to be trained based on the training samples held by the training member device itself.

[0025] Specifically, in the method for updating model parameters based on federated learning provided in the embodiments of this specification, the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregated model is calculated, and the model parameters of the model to be trained corresponding to the first correlation coefficient are updated to the model parameters of the aggregated model corresponding to the first correlation coefficient, thereby retaining the personalized model parameters of the model to be trained, and training the updated model to be trained based on the training samples to obtain a personalized model, thereby ensuring the diversity of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 is a flow chart of a method for updating model parameters based on federated learning provided in an embodiment of this specification;

[0027] Figure 2It is a processing flow chart of a method for updating model parameters based on federated learning, which is applied to a scenario where a model is trained through federated learning, provided in an embodiment of this specification;

[0028] Figure 3 It is a structural diagram of a system for updating model parameters based on federated learning provided in an embodiment of this specification;

[0029] Figure 4 It is a structural block diagram of a computing device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0030] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0031] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0032] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0033] First, the terms involved in one or more embodiments of this specification are explained.

[0034] Training member: Each data owner that participates in the joint training of the model.

[0035] Federated learning: also known as federated machine learning, joint learning, and alliance learning. Federated learning is a machine learning framework that can effectively help multiple companies and institutions use data and conduct machine learning modeling while meeting the requirements of user privacy protection, data security, and relevant regulations.

[0036] Non-IID data set: Not identically and independently distributed data set.

[0037] CIFAR-10: A more ubiquitous color image dataset.

[0038] ResNET-50: A residual network.

[0039] TOC: To Customer, which means facing consumers (generally referring to users).

[0040] SGD: Stochastic Gradient Descent.

[0041] With the development of artificial intelligence technology, deep neural networks (DNN) have gradually been applied to risk assessment, speech recognition, natural language processing and other fields. However, the DNN network structure in different application scenarios is relatively fixed, so in order to achieve better model performance, it is necessary to train the DNN model with more training data.

[0042] In the fields of medicine and finance, different companies or institutions have different data samples. Once these data are jointly trained, the accuracy of the model will be greatly improved, bringing huge economic benefits to companies and institutions. However, these training data contain a large amount of user privacy and commercial secrets. Once the information is leaked, it will have an irreversible negative impact on companies and institutions (training members). Therefore, the DNN model is trained by adopting federated learning. The federated learning means that the training members train the model with the assistance of the third-party platform C. The third-party platform C issues a public key to the training members to encrypt the data that needs to be exchanged during the training process. The training members exchange encrypted data to obtain the intermediate results of the gradient, and then calculate the encrypted gradient and loss with the assistance of the third-party platform C. The third-party platform C sends the decrypted gradient back to the training members respectively, and the training members update their respective models according to the gradient.

[0043] However, because the sample data of data owners (enterprises and institutions) correspond to different users, users are located in different regions, and the time windows of data collection are different, these sample data sets often have different feature distributions or label distributions during joint training, and the features are not independent of each other; this type of sample data set is usually called a Non-IID data set. Taking the uneven label distribution as an example, suppose that for the CIFAR-10 image data set, there are ten types of images in the data set: airplanes, cars, birds, etc.; when multiple parties conduct joint training, one party only has one or several types of images, such as training member A only contains airplane images, training member B only contains car images, and so on. Therefore, the sample label distribution between training members is uneven.

[0044] In addition, as the complexity of tasks and performance requirements gradually increase, the number of network layers of the model tends to gradually deepen, and the model parameters are also increasing accordingly. Taking the face recognition ResNET-50 as an example, the original model has more than 20 million parameters and the model size exceeds 100MB. Especially in the TOC scenario, due to the large number of training members participating in federated learning, the data received by the server increases exponentially, which can easily cause communication congestion and seriously affect the overall training efficiency. Therefore, in the process of transmitting the federated learning model, the entire model is compressed and uploaded to reduce the pressure of communication transmission.

[0045] However, although this method compresses and uploads the entire model, the communication transmission time is also much longer than the model training time, which seriously affects the overall training efficiency of the model. At the same time, federated learning builds a unified model based on the assumption that all data sets have the same distribution and the features are independent of each other. However, for the case of Non-IID data sets of training members, it is impossible to achieve good overall model performance. Moreover, in the process of model update, the method of directly using the federated model in the server to replace the local model of the training member cannot achieve personalized representation for local data, and the model diversity is affected. In addition, in the process of federated learning using algorithms such as SGD, even if the training members are IID data, the data distribution of each batch is not the same, and there is still a large performance loss when aggregating the model.

[0046] Based on this, the method for updating model parameters based on federated learning provided in the implementation of this specification is implemented by any training member device among the participants, and the participants include multiple training member devices and a server. And, the method includes multiple rounds of iterative updates of the model parameters, wherein during one round of iterative updates, the training member device can determine the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregate model when obtaining the current round of the training member device's model to be trained and the aggregate model issued by the server in the current round, wherein the higher the correlation between the corresponding model parameters, the greater the correlation coefficient.

[0047] After calculating the correlation coefficient, the first correlation coefficient and the second correlation coefficient are determined from the correlation coefficient, and the model parameters of the model to be trained corresponding to the first correlation coefficient are updated to the model parameters of the aggregate model corresponding to the first correlation coefficient, and the model parameters of the model to be trained corresponding to the second correlation coefficient are kept unchanged. Thus, based on the correlation between the federated model (aggregated model) and the local model (model to be trained), the layers in the local model with a high correlation with the federated model are federated updated, thereby retaining the personalized model layers in the local model of the training member itself.

[0048] Afterwards, when the training member device trains the updated model to be trained based on the training samples held by the training member device itself, since the updated model to be trained contains model layers that have not been updated and have a higher personalized representation, the above-mentioned method of directly replacing the local model of the training member with the federated model is avoided, which leads to the inability to achieve personalized representation of local data and affects model diversity.

[0049] Moreover, by training the members' own Non-IID data sets, better overall model performance can be achieved in the process of training the model to be trained that includes the model layer with higher personalized representation of the training members themselves; and the problem of large performance loss when aggregating the model is avoided due to the different data distribution of each batch of the training members themselves.

[0050] In addition, considering that during the transmission of the federated learning model, although the method of compressing and uploading the entire model can reduce the pressure of communication transmission to a certain extent; however, although this method compresses and uploads the entire model, the communication transmission time is also much longer than the model training time, which seriously affects the overall training efficiency of the model. Based on this, in the method of updating model parameters based on federated learning, the method of uploading partial layer models is adopted, which reduces the overall communication volume in the federated training process and improves the training efficiency.

[0051] Specifically, in this specification, a method for updating model parameters based on federated learning is provided. This specification also relates to a system for updating model parameters based on federated learning, a computing device, a computer-readable storage medium, and a computer program, which are described in detail one by one in the following embodiments.

[0052] See also Figure 1 , Figure 1 A flowchart of a method for updating model parameters based on federated learning according to an embodiment of the present specification is shown, wherein the method is implemented by any training member device among the participants, wherein the participants include multiple training member devices and a server, and the method includes performing multiple rounds of iterative updates on the model parameters, wherein one round of iterative updates specifically includes the following steps:

[0053] Step 102: Obtain the current round of to-be-trained models of the training member devices and the current round of aggregated models sent by the server.

[0054] In practical applications, federated learning may include multiple participants, which are used for joint modeling, and the participants include multiple training member devices and servers. The multiple training member devices and servers can perform multiple rounds of iterative updates on the model parameters of the training model to be trained, thereby training the training model in a federated learning manner. The method for updating model parameters based on federated learning provided in the embodiments of this specification can be implemented by any training member device among the participants.

[0055] The model to be trained can be understood as a model stored in a training member device, and the aggregate model can be understood as a model sent by the server to the training member device to help the training member device train the model to be trained stored in itself. It should be noted that the model to be trained and the aggregate model are models of the same type. The types of the model to be trained and the aggregate model include but are not limited to logistic regression models, neural network models, decision tree models, deep learning network (DNN) models, etc. In actual applications, the method for updating model parameters based on federated learning provided in this specification is applied in different scenarios, and the model to be trained and the aggregated model are also different. For example, when the method for updating model parameters based on federated learning is applied to a risk control scenario, the model to be trained is a local risk control model, and the aggregated model is a federal risk control model; when the method for updating model parameters based on federated learning is applied to a speech recognition scenario, the model to be trained is a local speech recognition model, and the aggregated model is a federated speech recognition model; when the method for updating model parameters based on federated learning is applied to a natural language processing scenario, the model to be trained is a local natural language processing model, and the aggregated model is a federated natural language processing model; in order to avoid excessive statements, this specification takes the example that the model to be trained is a local risk control model and the aggregated model is a federal risk control model for explanation.

[0056] In actual applications, multiple training member devices send encrypted training data to the server (third-party platform), which generates an aggregate model based on the training data and returns the aggregate model to each training member. After receiving the aggregate model, each training member updates the model parameters in the local model to be trained based on the model parameters of the aggregate model of the training member device, thereby achieving the goal of training the model to be trained through federated learning while retaining the personalized model to be trained of the training members.

[0057] The training data can be understood as user behavior data stored locally on the training members. For example, when the training members are financial enterprises, the project data may include domestic transfer records, cross-border transfer records, etc. For example, when the training members are Internet e-commerce platforms, the project data may include shopping records, product browsing records, etc.

[0058] In one embodiment provided in this specification, the aggregate model sent by the server in the current round is a model generated based on training data sent by multiple training member devices; before obtaining the current round of to-be-trained models of the training member devices and the aggregate model sent by the server in the current round, it also includes:

[0059] Acquire model generation data of the training member device, and send the model generation data to the server;

[0060] Receiving the aggregation model to be trained sent by the server, wherein the aggregation model to be trained is a model generated based on the model generation data;

[0061] Training the aggregation model to be trained based on the training samples held by the training member device itself and for the aggregation model to be trained;

[0062] The trained aggregation model to be trained is sent to the server, so that the server generates an aggregation model based on the aggregation model to be trained.

[0063] The model generation data may be understood as local data sent by the training member device to the server and used to generate the aggregate model to be trained, for example, training samples stored in the training member device itself.

[0064] Specifically, during the process of federated learning, the training member device first obtains the model generation data stored in itself for generating the aggregate model, and sends the model training data to the server. After receiving the model generation data, the server generates the aggregate model to be trained based on the model generation data, and sends the aggregate model to be trained to each training member device.

[0065] After receiving the aggregate model to be trained, each training member device can train the aggregate model to be trained from the training samples it holds for the aggregate model to be trained. In practical applications, the method for updating model parameters based on federated learning provided in this specification can adopt a batch-training method to divide the training data set into multiple data subsets (batches), and train the aggregate model to be trained through multiple data subsets, thereby improving memory utilization and improving the efficiency of model training.

[0066] After the aggregation model to be trained is trained, the training member device sends the aggregation model to be trained to the server, so that the server generates an aggregation model based on the aggregation model to be trained.

[0067] The following is a further explanation of the generation of an aggregate model using the method of updating model parameters based on federated learning in the case of risk control scenarios. The model generation data is the user's domestic transaction data, financial enterprise A is a training member of federated learning, and the device used by financial enterprise A for model training is a training member device. Based on this,

[0068] The device encrypts and uploads its own domestic transaction data of users to the server. The server generates a federal risk control model (aggregation model to be trained) with N layers (weight matrix) based on the received domestic transaction data of users and the cross-border transaction data of users encrypted and uploaded by other financial enterprises, and sends the federal risk control model to financial enterprise A and other financial enterprises respectively.

[0069] After receiving the federal risk control model, the device of financial enterprise A trains the federal risk control model using its own data subset used for training the federal risk control model, and sends the trained federal risk control model to the server.

[0070] After receiving the trained federal risk control model sent by the device of financial enterprise A, the server generates a federal risk control model based on the federal risk control model and the federal risk control models uploaded by other financial enterprises.

[0071] In the embodiments of the present specification, multiple training members train the model in a federated learning manner, thereby improving the efficiency of model training, avoiding the problem of data islands, and improving data utilization.

[0072] Furthermore, in one embodiment of the present specification, after completing the training of the aggregate model to be trained, the training member device can use the trained aggregate model to be trained as the local model to be trained in subsequent model iteration updates; the specific implementation method is as follows.

[0073] The obtaining the to-be-trained model of the current round of the training member device and the aggregated model sent by the server in the current round includes:

[0074] The aggregate model sent by the server in the current round is received, and the aggregate model to be trained is determined as the model to be trained in the current round of the training member device.

[0075] Specifically, during the process of multiple rounds of iterative updates of model parameters, after receiving the aggregate model sent by the server in the current round, the training member device can use the trained aggregate model to be trained as the model to be trained in the current round, thereby implementing the model parameter update of the current round based on the model to be trained and the aggregate model.

[0076] Step 104: Calculate the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregated model, wherein the higher the correlation between the corresponding model parameters, the greater the correlation coefficient.

[0077] The model parameters can be understood as the layers in the model, or the weight matrices of each layer in the model. It should be noted that since the model to be trained and the aggregate model are of the same type, there is a corresponding relationship between the model parameters of the two models. For example, the aggregate model has a total of N layers of weight matrices, and correspondingly, the model to be trained has N layers of weight matrices; and the aggregate model corresponds one-to-one to each layer of weight matrices in the model to be trained.

[0078] The correlation coefficient can be understood as a coefficient used to characterize the correlation between the model to be trained and the layer weight matrix in the aggregation model; the type of the correlation coefficient can be set according to the actual application scenario, and this specification does not impose specific restrictions on this, for example, the correlation distance.

[0079] In practical applications, since the model to be trained is determined based on the trained aggregate model to be trained, the model architecture of the model to be trained and the aggregate model are the same, and the aggregate model corresponds one-to-one to each layer of the weight matrix in the model to be trained; therefore, in the process of calculating the correlation coefficient between the model parameters in the aggregate model and the model parameters in the model to be trained, in order to avoid confusion in the calculation process and calculate a more accurate correlation coefficient, it is necessary to determine the correspondence between the model parameters in the aggregate model and the model parameters in the model to be trained, and calculate the correlation coefficient based on the correspondence. The specific implementation method is as follows.

[0080] The calculating the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregated model includes:

[0081] Respectively determining the model parameters in the to-be-trained model and the sequence information of the model parameters in the aggregated model;

[0082] Determine corresponding model parameters between the to-be-trained model and the aggregated model based on the sequence information;

[0083] The corresponding model parameters are subjected to correlation calculation to obtain the correlation coefficients between the corresponding model parameters.

[0084] Among them, when the model parameters are the weight matrices in the model, the sequence information can be understood as the sorting information of the weight matrices of each layer in the model, the position information of the weight matrices of each layer in the model, etc. For example, when the attribute information is the position information of the layer weight matrix, the correspondence between the first layer weight matrix of the aggregation model and the first layer weight matrix of the model to be trained can be determined.

[0085] Specifically, after determining the model to be trained in the current round and receiving the aggregate model sent by the server in the current round, the training member device determines the sequence information of the model parameters in the model to be trained and the sequence information of the model parameters in the aggregate model.

[0086] Then, the corresponding model parameters between the model to be trained and the aggregated model are determined based on the sequence information, and the corresponding model parameters are correlated to obtain the correlation coefficients between the corresponding model parameters.

[0087] Using the above example, the sequence information is the location information of the weight matrix of each layer, and the aggregate model is the federal risk control model. The model to be trained is the local risk control model. Based on this, the device of financial enterprise A obtains the federal risk control model sent by the server, and determines the weight matrix of each layer in the federal risk control model and the location information of each layer weight matrix, and determines the weight matrix of each layer in the local risk control model and the location information of each layer weight matrix.

[0088] Based on the location information, a corresponding relationship is established between the first-layer weight matrix of the updated federal risk control model and the first-layer weight matrix in the local risk control model. After that, the equipment of financial enterprise A continues to establish a corresponding relationship between the second-layer weight matrix of the updated federal risk control model and the second-layer weight matrix in the local risk control model, until each layer of weight matrix in the local risk control model and each layer of weight matrix in the updated federal risk control model complete the corresponding relationship. Since the local risk control model and the updated federal risk control model have the same model architecture, each layer of weight matrix in the updated federal risk control model can correspond one-to-one with each layer of weight matrix in the local risk control model.

[0089] After determining the layer weight matrix corresponding to each layer weight matrix in the local risk control model from the federal risk control model, the correlation distance between each layer weight matrix in the local risk control model and the layer weight matrix corresponding to each layer weight matrix in the federal risk control model and the local risk control model can be calculated, and the correlation distance is used as the correlation coefficient of the corresponding weight matrix between the local risk control model and the federal risk control model.

[0090] In the embodiments provided in this specification, the step of performing correlation calculation on the corresponding model parameters to obtain the correlation coefficient between the corresponding model parameters includes:

[0091] Determining a first model parameter in the model to be trained, and determining a second model parameter corresponding to the first model parameter from the aggregated model;

[0092] Transposing the first model parameters to obtain first transposed model parameters, and transposing the second model parameters to obtain second transposed model parameters;

[0093] Multiplying the first model parameter and the first transposed model parameter to obtain a first model parameter to be processed;

[0094] Multiplying the second model parameter and the second transposed model parameter to obtain a second model parameter to be processed;

[0095] Multiplying the first model parameter, the first transposed model parameter, the second model parameter and the second transposed model parameter to obtain a third model parameter to be processed;

[0096] Determine a correlation distance between the first model parameter and the second model parameter according to the traces respectively corresponding to the first model parameter to be processed, the second model parameter to be processed, and the third model parameter to be processed.

[0097] Among them, when the model parameter is the weight matrix of the model, the first model parameter is all weight matrices that need to be transposed in the model to be trained; correspondingly, since the model structure of the model to be trained and the aggregation model is the same, based on this, the second model parameter is all weight matrices in the aggregation model.

[0098] Continuing with the above example, after determining the corresponding weight matrix between the federal risk control model and the local risk control model, each weight matrix of the federal risk control model and each weight matrix of the local risk control model can be transposed to obtain multiple transposed weight matrices of the federal risk control model and multiple transposed weight matrices of the local risk control model.

[0099] Afterwards, determine the corresponding transposed weight matrix of the first layer weight matrix of the local risk control model that has not been transposed, and multiply the first layer weight matrix that has not been transposed by the corresponding transposed weight matrix to obtain a new weight matrix, which is used to calculate the correlation coefficient. Correspondingly, perform the same operation as the first layer weight matrix on the remaining weight matrices in the local risk control model (such as the second layer weight matrix to the Nth layer weight matrix). Thus, a new weight matrix corresponding to the local risk control model is obtained.

[0100] For each layer of weight matrix that has not been transposed in the federal risk control model, the above operation is also performed on the first layer of weight matrix that has not been transposed in the local risk control model; that is, for each layer of weight matrix that has not been transposed in the federal risk control model, the corresponding transposed weight matrix is ​​also determined, and the two are multiplied; finally, a new weight matrix corresponding to the federal risk control model is obtained.

[0101] In addition, it is necessary to multiply each layer of the weight matrix of the local risk control model that has not been transposed and its corresponding transposed weight matrix, as well as each layer of the weight matrix of the federal risk control model that has not been transposed and its corresponding transposed weight matrix, so as to obtain new weight matrices corresponding to the local risk control model and the federal risk control model.

[0102] Then, based on the calculated trace of the new weight matrix corresponding to the local risk control model, the trace of the new weight matrix corresponding to the federal risk control model, and the trace of the new weight matrices corresponding to the local risk control model and the federal risk control model, the correlation distance of the corresponding weight matrices between the local risk control model and the federal risk control model is determined.

[0103] In practical applications, the correlation distance between the weight matrix layers corresponding to each layer of the weight matrix in the local risk control model and each layer of the weight matrix in the federal risk control model and the local risk control model can be calculated by formula 1.

[0104]

[0105] Where, t is the tth iteration training; j is the number of layers of the model; is the correlation distance of the t-th iteration training; W s,j is the jth layer (weight matrix) of the federal risk control model; W i,j is the jth layer of the local risk control model; Tr is the trace of the weight matrix (layer) of the model; is the jth layer of the federal risk control model after transposition; It is the jth layer of the local risk control model after transposition.

[0106] Step 106: Determine a first correlation coefficient and a second correlation coefficient from the correlation coefficients, wherein the first correlation coefficient is greater than the second correlation coefficient.

[0107] In one embodiment provided in the present specification, the correlation coefficients can be sorted in descending order, and the first correlation coefficient and the second correlation coefficient can be accurately determined from the descending sorting results, so as to facilitate the subsequent updating of the model parameters in the to-be-trained model based on the first correlation coefficient and the second correlation coefficient, thereby obtaining a local to-be-trained model with higher personalized representation, thereby improving the diversity of the models obtained by the training members. The specific implementation method is as follows.

[0108] The determining of the first correlation coefficient and the second correlation coefficient from the correlation coefficients comprises:

[0109] Sorting the correlation coefficients in descending order to obtain descending order results corresponding to the correlation coefficients;

[0110] Selecting a preset number of correlation coefficients from the descending sorting results from top to bottom as first correlation coefficients;

[0111] The correlation coefficients in the descending sorting result except the first correlation coefficient are determined as second correlation coefficients.

[0112] The first correlation coefficient may be understood as a coefficient that can characterize a system with a higher correlation between corresponding model parameters, and correspondingly, the second correlation coefficient may be understood as a system that can characterize a system with a lower correlation between corresponding model parameters.

[0113] The preset number can be set according to the actual application scenario, and this specification does not impose any specific restrictions on this. For example, the preset number is 20, 10, and so on.

[0114] Specifically, after calculating the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregated model, the training member device can sort the correlation coefficient in descending order to obtain a descending sorting result corresponding to the correlation coefficient; then, the training member device selects a preset number of correlation coefficients from the descending sorting result from top to bottom as the first correlation coefficient; and determines the correlation coefficient other than the first correlation coefficient in the descending sorting result as the second correlation coefficient, thereby achieving the purpose of determining the first correlation coefficient and the second correlation coefficient from the correlation coefficient.

[0115] Using the above example, the determination of the first correlation coefficient and the second correlation coefficient based on the descending sorting results corresponding to the correlation coefficients is further explained, wherein the preset number may be 20.

[0116] After obtaining the correlation distance, financial enterprise A determines the correlation distance corresponding to each layer of the weight matrix in the updated federal risk control model, and sorts the correlation distance in descending order, thereby obtaining a descending sort result of the correlation distance.

[0117] The first 20 correlation distances are selected from the descending sort result in order from top to bottom, and the first 20 correlation distances are used as the first correlation distances, and all correlation distances except the first 20 correlation distances in the descending sort result are used as the second correlation distances.

[0118] Step 108: Update the model parameters of the model to be trained corresponding to the first correlation coefficient to the model parameters of the aggregation model corresponding to the first correlation coefficient, and keep the model parameters of the model to be trained corresponding to the second correlation coefficient unchanged.

[0119] Specifically, after determining the first correlation coefficient and the second correlation coefficient, the training member device can determine the model parameters corresponding to the first correlation coefficient from the model to be trained, and determine the model parameters corresponding to the first correlation coefficient from the aggregate model.

[0120] Afterwards, the training member device updates the model parameters corresponding to the first correlation coefficient in the model to be trained to the model parameters corresponding to the first correlation coefficient in the aggregation model, and the model parameters corresponding to the second correlation coefficient in the model to be trained remain unchanged, thereby obtaining an updated model to be trained.

[0121] During the specific implementation process, the training member device updates the model parameters corresponding to the first correlation coefficient in the model to be trained with the model parameters corresponding to the first correlation coefficient in the aggregate model. This operation can be understood as the training member device replacing the model parameters corresponding to the first correlation coefficient in the model to be trained with the model parameters corresponding to the first correlation coefficient in the aggregate model.

[0122] Continuing with the above example, after the training member device determines the layer weight matrix corresponding to the first correlation distance from the updated federal risk control model, it also determines the layer weight matrix corresponding to the first correlation distance from the local risk control model. For example, the layers corresponding to the first correlation distance in the updated federal risk control model are the 5th and 8th layers, and correspondingly, the corresponding layers in the local risk control model are also the 5th and 8th layers.

[0123] The 5th and 8th layers in the local risk control model are replaced by the 5th and 8th layers in the updated federal risk control model, thereby obtaining a local risk control model that includes the 5th and 8th layers in the updated federal risk control model.

[0124] Step 110: training the updated model to be trained based on the training samples held by the training member device itself.

[0125] Specifically, after obtaining the updated model to be trained, the training member device can train the updated model to be trained based on the training samples held by the training member device itself until the training stop condition is reached. The training stop condition can be set according to the actual application scenario, and this specification does not specifically limit this. For example, the loss value of the model to be trained reaches convergence.

[0126] In practical applications, the training member device trains the updated model to be trained based on the training samples by performing forward propagation processing and backward propagation processing on the updated model to be trained through the training data.

[0127] Continuing with the above example, after obtaining the updated local risk control model, the training member device performs forward propagation and backward propagation processing on the training member's local data subset, thereby optimizing the replaced layer in the local risk control model and obtaining the optimized local risk control model, thereby obtaining a model to be trained with strong personalized representation.

[0128] The method for updating model parameters based on federated learning provided in an embodiment of this specification adopts the method of uploading partial layer models, which reduces the overall communication volume during the federated training process and improves the training efficiency. The specific implementation method is as follows.

[0129] After training the updated model to be trained based on the training samples held by the training member device itself, the method further includes:

[0130] The trained model to be trained is used as the final model of the current round of the training member device;

[0131] The model parameters to be sent are determined from the model parameters of the final model based on the correlation coefficient, and the model parameters to be sent are sent to the server.

[0132] Specifically, after the training member device trains the updated model to be trained based on the training samples, the trained model to be trained can be used as the final model of the current round in the process of multiple rounds of iterative updates.

[0133] At the same time, in order to reduce the overall communication volume during the federated training process and improve the training efficiency, the training member device determines the model parameters to be sent from the model parameters of the final model based on the correlation coefficient, and sends the model parameters to be sent to the server.

[0134] In one embodiment provided in this specification, the determining of the model parameters to be sent from the model parameters of the final model based on the correlation coefficient includes:

[0135] Determining an update identification parameter corresponding to the model parameter of the final model, wherein the update identification parameter is determined based on the first correlation coefficient and the second correlation coefficient, the update identification parameter corresponding to the first correlation coefficient is not 0, and the update identification parameter corresponding to the second correlation coefficient is 0;

[0136] By multiplying the model parameter corresponding to the second correlation coefficient in the final model by the update identification parameter corresponding to the second correlation coefficient, the model parameter corresponding to the second correlation coefficient in the final model is deleted;

[0137] The model parameters remaining in the final model and corresponding to the first correlation coefficient are multiplied by the update identification parameter corresponding to the first correlation coefficient to obtain the model parameters to be sent.

[0138] The update identification parameter can be understood as a parameter that can identify the updated model parameters and the unupdated model parameters in the model to be trained. In practical applications, after determining the first correlation coefficient and the second correlation coefficient, the training member device can determine an update identification parameter that is not 0 for each model parameter corresponding to the first correlation coefficient in the model to be trained, for example. An update identification parameter of 1; and an update identification parameter of 0 for each model parameter corresponding to the second correlation coefficient in the model to be trained. The update identification parameter can be stored in a list, a file, an array, etc., and this specification does not specifically limit this.

[0139] Specifically, after the training member device trains the model to be trained through training samples and obtains the final model, the training member device considers that the communication transmission time required to upload the final model to the server is much longer than the training time of the model, which seriously affects the overall training efficiency of the model.

[0140] Based on this, after obtaining the final model, the training member device can determine the update identification parameters corresponding to the model parameters of the final model. It should be noted that the update identification parameters are determined based on the first correlation coefficient and the second correlation coefficient, and the update identification parameters corresponding to the first correlation coefficient are not 0, and the update identification parameters corresponding to the second correlation coefficient are 0.

[0141] Afterwards, the training member device multiplies the model parameters corresponding to the second correlation coefficient in the final model by the update identification parameter of 0, thereby deleting the model parameters corresponding to the second correlation coefficient in the final model.

[0142] In addition, the remaining model parameters corresponding to the first correlation coefficient in the final model are multiplied by the update identification parameter corresponding to the first correlation coefficient to obtain the model parameters to be sent; for example, the update identification parameter corresponding to the first correlation coefficient is 1; therefore, the model parameters corresponding to the first correlation coefficient in the final model and the update identification parameter of 1 are multiplied by element-wise multiplication to obtain the model parameters to be sent to the server. Subsequent training member devices only need to send the model parameters to be sent to the server, thereby reducing the overall communication volume during the federated training process and improving the training efficiency.

[0143] In one embodiment provided in this specification, the sending of the model parameters to be sent to the server includes:

[0144] Determining the training samples held by the training member device itself;

[0145] Encrypting the training sample and the model parameters to be sent by using a preset encryption algorithm to obtain encrypted training samples and model parameters to be sent;

[0146] The encrypted training samples and the model parameters to be sent are sent to the server.

[0147] Among them, the preset encryption algorithm can be set according to the actual application scenario, and this manual does not impose specific restrictions on this, for example, differential privacy encryption algorithm, homomorphic encryption algorithm.

[0148] Using the above example, after the training member device trains the updated local risk control model with the local training sample data, the layer corresponding to the first correlation distance in the trained local risk control model, that is, the layer with higher correlation, is used as the layer that needs to be reported to the server, and the layer that needs to be reported to the server and the quantity parameters of the sample data for training the local risk control model are encrypted by a privacy encryption algorithm or a homomorphic encryption algorithm, and the encrypted layer and quantity parameters are sent to the server. This ensures the security of the data uploaded to the server.

[0149] In actual applications, after the encrypted layers and the number parameters of the local training samples are sent to the server, the server will iteratively update the aggregation model (federated model) that has been iteratively updated for multiple times and stored in the third-party platform based on the encrypted layers and the number parameters, and send the iteratively updated federated model to the training member device. After receiving the federated model sent by the server, the training member device will repeatedly update the model parameters in the training model based on the model parameters in the federated model until the model training completion condition in the federated learning process is met.

[0150] In the embodiments provided in this specification, the method for updating model parameters based on federated learning calculates the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregated model, and updates the model parameters of the model to be trained corresponding to the first correlation coefficient to the model parameters of the aggregated model corresponding to the first correlation coefficient, thereby retaining the personalized model parameters of the model to be trained, and training the updated model to be trained based on the training samples to obtain a personalized model, thereby ensuring the diversity of the model.

[0151] The following combination Figure 2 Taking the application of the method for updating model parameters based on federated learning provided in this specification in the scenario of performing federated learning on the risk control model as an example, the method for updating model parameters based on federated learning is further described. Figure 2A processing flow chart of a method for updating model parameters based on federated learning, which is applied to a scenario where a model is trained through federated learning, provided in an embodiment of this specification, is shown, and specifically includes the following steps:

[0152] Step 202: The server initializes the federated model based on the training data set.

[0153] The training data set may be understood as the Non-IID data set in the above embodiment, and the federated model may be understood as the aggregation model in the above embodiment.

[0154] Specifically, the server encrypts and uploads the training data of K training members to form a Non-IID data set, wherein the data of each training member of the K training members is Xi, {i=1,2,...,k}.

[0155] A federated model is generated based on the Non-IID data set. The federated model may have n layers, for example, W=[W1, W2, ..., Wn], where W is the federated model, and W1, W2, ..., Wn are layers (weight matrices) in the federated model.

[0156] The parameters of the federated model are initialized by the server, and the federated model is sent to each training member. For example, the federated model in the server is WS = [W s,1 ,W s,2 ,...,W s,j ,...,W s,n ], Ws is s federation models; W s,1 ,W s,2 ,...,W s,j ,...,W s,n The layer of the federation model.

[0157] Step 204: The training member iteratively optimizes the received federated model to obtain a local model.

[0158] Training member i iteratively optimizes the received federated model based on local training data, and obtains the local model of training member i as Wi = [W i,1 ,W i,2 ,...W i,j ,...,W i,n ], where W i,1 ,W i,2 ,...W i,j ,...,W i,n is the layer of the local model. And the local model is sent to the server.

[0159] Step 206: The server updates the federated model based on the received local model.

[0160] Specifically, the server updates the federated model based on the received local model to obtain an updated federated model; and sends the updated federated model to the training members for iterative optimization.

[0161] Step 208: The training member determines the correlation coefficient between the local model and the updated federated model.

[0162] Specifically, during the iterative optimization process of the tth federated model, training member i receives the tth optimized federated model Calculate separately Zhongyu The correlation coefficient between the layers in is the local model of member i trained in the t-th federated learning, Can be the correlation distance. The correlation distance can be calculated based on the above formula (1).

[0163] Step 210: The training member replaces the weight layer of the local model based on the updated federated model.

[0164] Specifically, train members to Sort in descending order, and select the p correlation coefficients with the largest values ​​from top to bottom; training member i determines the weight matrix (weight layer) corresponding to the p correlation coefficients from the federal model; and determines the weight matrix (weight layer) corresponding to the p correlation coefficients in the local model. And determine the update parameters (i.e., the update identification parameters in the above embodiment) for the weight matrix according to the correlation coefficient, wherein the update parameter corresponding to the weight matrix corresponding to the p correlation coefficients in the local model is 1; the update parameter corresponding to the weight matrix that does not correspond to the p correlation coefficients in the local model is 0. After determining the update parameters, training member i stores the update parameters corresponding to each weight matrix in the local model in the index list I, and obtains the Index list I corresponding to the p model weight matrices.

[0165] From the multiple layers of the local model, determine the associated layers corresponding to the p model weight matrices in the federated model, and replace the layers in the local model with the p model weight matrices. The remaining weight matrices (weight layers) in the local model remain unchanged, thereby retaining the model weight matrix with the most global information in the training member, and finally obtaining the model weight list of the replaced local model

[0166] Step 212: The training member trains the replaced model based on the sample data.

[0167] Specifically, training member i reads a batch of sample data For the replaced model The forward propagation and backward propagation of (ie the final model in the above embodiment).

[0168] Step 214: The training member performs computational processing on the trained model through Index list I.

[0169] Specifically, training member i obtains the updated parameters in Index list I and updates the trained model Perform element-wise multiplication on the weight matrix in to get the model weight list that needs to be uploaded (ie, the model parameters to be sent in the above embodiment).

[0170] Step 216: The training member uploads the model weight list in the local model to the server.

[0171] Specifically, the training members use encryption algorithms such as differential privacy and homomorphic encryption to list the model weights. Encrypted and uploaded to the server.

[0172] And, in place of the model A list of model weights While encrypting and uploading to the server, the current sample size is encrypted using differential privacy, homomorphic encryption and other encryption algorithms. Encrypted upload to the server.

[0173] Step 218: The server iteratively updates the federated model based on the model weight list.

[0174] Specifically, the server passes the model weight list And the sample size (i.e. training sample), perform the t+1th iteration update on the federated model in the server, and obtain the t+1th iteration updated federated model Among them, the t+1th iteration updates the federated model It is calculated by formula (2).

[0175]

[0176] The N t is the sample size of the server for updating the federated model at the tth iteration.

[0177] In obtaining the federal model After that, the server continues to Return to each training member (i.e., training member device) until the corresponding model termination condition is reached and the model training is completed.

[0178] In practical applications, the execution order of step 208 and step 210 and step 212 can be adjusted according to actual needs, and this specification does not make any specific limitation.

[0179] The method for updating model parameters based on federated learning provided in the embodiments of this specification performs federated updates on the layers with stronger correlation coefficients in the local model based on the correlation between the federated model and the local model, retains the personalized model layers of the training members themselves, improves the model performance for the Non_IID data set, and, by uploading part of the model layers, reduces the overall communication volume during the federated training process and improves the training efficiency.

[0180] Corresponding to the above method embodiment, this specification also provides a system embodiment for updating model parameters based on federated learning. Figure 3 FIG. 1 shows a schematic diagram of a system for updating model parameters based on federated learning provided in an embodiment of this specification. Figure 3 As shown, the system is placed at any training member device among the participants, wherein the participants include multiple training member devices and a server,

[0181] The system is used to perform multiple rounds of iterative updates on model parameters, and the system comprises:

[0182] A model acquisition module 302 is used to acquire the to-be-trained model of the current round of the training member device and the aggregated model issued by the server in the current round;

[0183] A correlation coefficient calculation module 304 is used to calculate the correlation coefficient between the model parameters corresponding to the to-be-trained model and the aggregated model, wherein the higher the correlation between the corresponding model parameters, the greater the correlation coefficient;

[0184] A correlation coefficient determination module 306, configured to determine a first correlation coefficient and a second correlation coefficient from the correlation coefficients, wherein the first correlation coefficient is greater than the second correlation coefficient;

[0185] A model updating module 308, configured to update the model parameters of the model to be trained corresponding to the first correlation coefficient to the model parameters of the aggregated model corresponding to the first correlation coefficient, and to keep the model parameters of the model to be trained corresponding to the second correlation coefficient unchanged; and

[0186] The model training module 310 is used to train the updated model to be trained based on the training samples held by the training member device itself.

[0187] Optionally, the system for updating model parameters based on federated learning further includes a sending module, which is used to:

[0188] The trained model to be trained is used as the final model of the current round of the training member device;

[0189] The model parameters to be sent are determined from the model parameters of the final model based on the correlation coefficient, and the model parameters to be sent are sent to the server.

[0190] Optionally, the sending module is further used to:

[0191] Determining an update identification parameter corresponding to the model parameter of the final model, wherein the update identification parameter is determined based on the first correlation coefficient and the second correlation coefficient, the update identification parameter corresponding to the first correlation coefficient is not 0, and the update identification parameter corresponding to the second correlation coefficient is 0;

[0192] By multiplying the model parameter corresponding to the second correlation coefficient in the final model by the update identification parameter corresponding to the second correlation coefficient, the model parameter corresponding to the second correlation coefficient in the final model is deleted;

[0193] The model parameters remaining in the final model and corresponding to the first correlation coefficient are multiplied by the update identification parameter corresponding to the first correlation coefficient to obtain the model parameters to be sent.

[0194] Optionally, the sending module is further used to:

[0195] Determining the training samples held by the training member device itself;

[0196] Encrypting the training sample and the model parameters to be sent by using a preset encryption algorithm to obtain encrypted training samples and model parameters to be sent;

[0197] The encrypted training samples and the model parameters to be sent are sent to the server.

[0198] Optionally, the correlation coefficient calculation module 304 is further used to:

[0199] Respectively determining the model parameters in the to-be-trained model and the sequence information of the model parameters in the aggregated model;

[0200] Determine corresponding model parameters between the to-be-trained model and the aggregated model based on the sequence information;

[0201] The corresponding model parameters are subjected to correlation calculation to obtain the correlation coefficients between the corresponding model parameters.

[0202] Optionally, the correlation coefficient calculation module 304 is further used to:

[0203] Determining a first model parameter in the model to be trained, and determining a second model parameter corresponding to the first model parameter from the aggregated model;

[0204] Transposing the first model parameters to obtain first transposed model parameters, and transposing the second model parameters to obtain second transposed model parameters;

[0205] Multiplying the first model parameter and the first transposed model parameter to obtain a first model parameter to be processed;

[0206] Multiplying the second model parameter and the second transposed model parameter to obtain a second model parameter to be processed;

[0207] Multiplying the first model parameter, the first transposed model parameter, the second model parameter and the second transposed model parameter to obtain a third model parameter to be processed;

[0208] Determine a correlation distance between the first model parameter and the second model parameter according to the traces respectively corresponding to the first model parameter to be processed, the second model parameter to be processed, and the third model parameter to be processed.

[0209] Optionally, the correlation coefficient determination module 306 is further used to:

[0210] Sorting the correlation coefficients in descending order to obtain descending order results corresponding to the correlation coefficients;

[0211] Selecting a preset number of correlation coefficients from the descending sorting results from top to bottom as first correlation coefficients;

[0212] The correlation coefficients in the descending sorting result except the first correlation coefficient are determined as second correlation coefficients.

[0213] Optionally, the system for updating model parameters based on federated learning further includes a model generation module, which is used to:

[0214] Acquire model generation data of the training member device, and send the model generation data to the server;

[0215] Receiving the aggregation model to be trained sent by the server, wherein the aggregation model to be trained is a model generated based on the model generation data;

[0216] Training the aggregation model to be trained based on the training samples held by the training member device itself and for the aggregation model to be trained;

[0217] The trained aggregation model to be trained is sent to the server, so that the server generates an aggregation model based on the aggregation model to be trained.

[0218] Optionally, the model acquisition module 302 is further used to:

[0219] The aggregate model sent by the server in the current round is received, and the aggregate model to be trained is determined as the model to be trained in the current round of the training member device.

[0220] In the embodiments provided in this specification, a system for updating model parameters based on federated learning calculates the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregated model, and updates the model parameters of the model to be trained corresponding to the first correlation coefficient to the model parameters of the aggregated model corresponding to the first correlation coefficient, thereby retaining the personalized model parameters of the model to be trained, and training the updated model to be trained based on training samples to obtain a personalized model, thereby ensuring the diversity of the model.

[0221] The above is a schematic scheme of a system for updating model parameters based on federated learning in this embodiment. It should be noted that the technical scheme of the system for updating model parameters based on federated learning and the technical scheme of the method for updating model parameters based on federated learning belong to the same concept. For details not described in detail in the technical scheme of the system for updating model parameters based on federated learning, please refer to the description of the technical scheme of the method for updating model parameters based on federated learning.

[0222] Figure 4 The structure block diagram of a computing device 400 provided according to an embodiment of the present specification is shown. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.

[0223] The computing device 400 also includes an access device 440 that enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface (e.g., a network interface card (NIC)) wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0224] In one embodiment of the present specification, the above components of the computing device 400 and Figure 4 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 4 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0225] Computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 400 may also be a mobile or stationary server.

[0226] The processor 420 is used to execute computer executable instructions, which, when executed by the processor 420, implement any step of the method for updating model parameters based on federated learning.

[0227] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the method for updating model parameters based on federated learning belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the method for updating model parameters based on federated learning.

[0228] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, can implement any step of the method for updating model parameters based on federated learning.

[0229] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the method for updating model parameters based on federated learning belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the method for updating model parameters based on federated learning.

[0230] An embodiment of the present specification also provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute any step of the method for updating model parameters based on federated learning.

[0231] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the schematic scheme of the computer program and the technical scheme of the method for updating model parameters based on federated learning are of the same concept, and the details not described in detail in the schematic scheme of the computer program can be found in the description of the technical scheme of the method for updating model parameters based on federated learning.

[0232] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0233] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0234] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that this specification is not limited by the order of the actions described, because according to this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this specification.

[0235] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0236] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A method for updating model parameters based on federated learning, the method being implemented by any training member device among the participants, wherein: The participants include multiple training member devices and a server, The method comprises performing multiple rounds of iterative updates on the model parameters, wherein one round of iterative updates comprises: Obtaining the current round of to-be-trained models of the training member devices and the current round of aggregated models sent by the server; Calculating a correlation coefficient between model parameters corresponding to the model to be trained and the aggregate model, wherein the model to be trained and the aggregate model are models of the same type, determining a correspondence between model parameters in the aggregate model and model parameters in the model to be trained, and calculating the correlation coefficient based on the correspondence, wherein the higher the correlation between the corresponding model parameters, the greater the correlation coefficient; Determine a first correlation coefficient and a second correlation coefficient from the correlation coefficients, wherein the first correlation coefficient is greater than the second correlation coefficient; Updating the model parameters of the model to be trained corresponding to the first correlation coefficient to the model parameters of the aggregation model corresponding to the first correlation coefficient, and keeping the model parameters of the model to be trained corresponding to the second correlation coefficient unchanged; and The updated model to be trained is trained based on the training samples held by the training member device itself.

2. The method according to claim 1, after training the updated model to be trained based on the training samples held by the training member device itself, further comprises: The trained model to be trained is used as the final model of the current round of the training member device; The model parameters to be sent are determined from the model parameters of the final model based on the correlation coefficient, and the model parameters to be sent are sent to the server.

3. The method according to claim 2, wherein determining the model parameters to be sent from the model parameters of the final model based on the correlation coefficient comprises: Determining an update identification parameter corresponding to the model parameter of the final model, wherein the update identification parameter is determined based on the first correlation coefficient and the second correlation coefficient, the update identification parameter corresponding to the first correlation coefficient is not 0, and the update identification parameter corresponding to the second correlation coefficient is 0; By multiplying the model parameter corresponding to the second correlation coefficient in the final model by the update identification parameter corresponding to the second correlation coefficient, the model parameter corresponding to the second correlation coefficient in the final model is deleted; The model parameters remaining in the final model and corresponding to the first correlation coefficient are multiplied by the update identification parameter corresponding to the first correlation coefficient to obtain the model parameters to be sent.

4. The method according to claim 2, wherein sending the model parameters to be sent to the server comprises: Determining the training samples held by the training member device itself; Encrypting the training sample and the model parameters to be sent by using a preset encryption algorithm to obtain encrypted training samples and model parameters to be sent; The encrypted training samples and the model parameters to be sent are sent to the server.

5. According to the method of claim 1, the step of calculating the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregated model comprises: Respectively determining the model parameters in the to-be-trained model and the sequence information of the model parameters in the aggregated model; Determine corresponding model parameters between the to-be-trained model and the aggregated model based on the sequence information; The corresponding model parameters are subjected to correlation calculation to obtain the correlation coefficients between the corresponding model parameters.

6. The method according to claim 5, wherein the step of performing correlation calculation on the corresponding model parameters to obtain the correlation coefficient between the corresponding model parameters comprises: Determining a first model parameter in the model to be trained, and determining a second model parameter corresponding to the first model parameter from the aggregated model; Transposing the first model parameters to obtain first transposed model parameters, and transposing the second model parameters to obtain second transposed model parameters; Multiplying the first model parameter and the first transposed model parameter to obtain a first model parameter to be processed; Multiplying the second model parameter and the second transposed model parameter to obtain a second model parameter to be processed; Multiplying the first model parameter, the first transposed model parameter, the second model parameter and the second transposed model parameter to obtain a third model parameter to be processed; Determine a correlation distance between the first model parameter and the second model parameter according to the traces respectively corresponding to the first model parameter to be processed, the second model parameter to be processed, and the third model parameter to be processed.

7. The method according to claim 1, wherein determining a first correlation coefficient and a second correlation coefficient from the correlation coefficients comprises: Sorting the correlation coefficients in descending order to obtain descending order results corresponding to the correlation coefficients; Selecting a preset number of correlation coefficients from the descending sorting results from top to bottom as first correlation coefficients; The correlation coefficients in the descending sorting result except the first correlation coefficient are determined as second correlation coefficients.

8. The method according to claim 1, before obtaining the current round of to-be-trained models of the training member devices and the current round of aggregated models issued by the server, further comprising: Acquire model generation data of the training member device, and send the model generation data to the server; Receiving the aggregation model to be trained sent by the server, wherein the aggregation model to be trained is a model generated based on the model generation data; Training the aggregation model to be trained based on the training samples held by the training member device itself and for the aggregation model to be trained; The trained aggregation model to be trained is sent to the server, so that the server generates an aggregation model based on the aggregation model to be trained.

9. According to the method of claim 8, the step of obtaining the current round of to-be-trained models of the training member devices and the current round of aggregated models sent by the server comprises: The aggregate model sent by the server in the current round is received, and the aggregate model to be trained is determined as the model to be trained in the current round of the training member device.

10. A system for updating model parameters based on federated learning, wherein the system is placed at any training member device among the participants, wherein: The participants include multiple training member devices and a server, The system is used to perform multiple rounds of iterative updates on model parameters, and the system comprises: A model acquisition module, used to acquire the to-be-trained model of the current round of the training member device and the aggregated model issued by the server in the current round; A correlation coefficient calculation module, used to calculate the correlation coefficient between the model parameters corresponding to the model to be trained and the aggregate model, wherein the model to be trained and the aggregate model are models of the same type, determine the correspondence between the model parameters in the aggregate model and the model parameters in the model to be trained, and calculate the correlation coefficient based on the correspondence, the higher the correlation between the corresponding model parameters, the greater the correlation coefficient; A correlation coefficient determination module, used to determine a first correlation coefficient and a second correlation coefficient from the correlation coefficients, wherein the first correlation coefficient is greater than the second correlation coefficient; a model updating module, configured to update the model parameters of the model to be trained corresponding to the first correlation coefficient to the model parameters of the aggregation model corresponding to the first correlation coefficient, and to keep the model parameters of the model to be trained corresponding to the second correlation coefficient unchanged; and The model training module is used to train the updated model to be trained based on the training samples held by the training member device itself.

11. A computing device comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method described in any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.