Federal learning-based model training method and device, equipment, medium and product
By using federated learning, a central server coordinates multiple business parties to train the model and update gradients through interaction, which solves the problems of overfitting and low data security in training with individual data samples, and achieves more efficient and secure model training.
Patent Information
- Application Number
- CN202511520738.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-01-13
AI Technical Summary
When business users train models using data samples alone, the sample size is small, making it prone to overfitting and resulting in poor model training performance; while existing data fusion methods suffer from low data security issues.
By adopting a federated learning approach, multiple business units are coordinated through a central server to train the model. Each business unit performs local training and updates based on global model parameters and interacts to update gradients. The central server aggregates and integrates the parameters, avoiding data leakage and improving security.
It reduces overfitting at the model training terminal, improves model training effectiveness and efficiency, enhances data sample security, and shortens model convergence speed.
Smart Images

Figure CN121328664A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of distributed technology and artificial intelligence technology, and to the field of financial technology, specifically to a model training method, apparatus, device, medium, and product based on federated learning. Background Technology
[0002] With the popularization of artificial intelligence, various business entities have begun to use their own data samples to train models, so as to combine machine learning models to help carry out their business. Examples include product recommendation, search, and audio / video services.
[0003] However, if business units only use their own data samples for model training, the data sample size is relatively small, and overfitting is likely to occur, resulting in poor model training performance. If multiple business units collaborate on model training, the current common practice is to merge the data samples from each business unit before using them for model training, which carries lower data security. Summary of the Invention
[0004] In view of the above problems, this application provides a federated learning-based model training method, apparatus, device, medium and product for improving the security of sample data during model training.
[0005] According to a first aspect of this application, a federated learning-based model training method is provided, applied to a distributed system comprising one central terminal and N terminals; wherein N is a positive integer greater than 1; different terminals store different training sample sets locally; the method includes: the central terminal determining the initial model parameters of the model to be trained as the current model composite parameters, and sending them to the N terminals respectively; cyclically executing the following steps until a preset training stop condition is met: any terminal, based on the current model composite parameters, performs training and updates according to the locally stored training sample set to obtain first model terminal parameters; different terminals interact to update the gradient of parameters; any terminal integrates the received parameters from other terminals to update the gradient, determines the composite gradient, and updates its own first model terminal parameters according to the determined composite gradient to obtain second model terminal parameters; the central terminal integrates the second model terminal parameters of multiple terminals, updates the current model composite parameters, and sends the updated current model composite parameters to the N terminals respectively.
[0006] Optionally, the interaction parameter update gradient between different terminals includes: any terminal for any other terminal, determining the intersection of the training sample set with the other terminal, and based on its own first model terminal parameters, determining the parameter update gradient according to the training samples in the determined intersection, and sending the determined parameter update gradient to the other terminal.
[0007] Optionally, the determination of the comprehensive gradient by integrating the parameter update gradients received by any terminal from other terminals includes: determining the corresponding gradient weights for any other terminal that updates the gradient of the interaction parameters based on the intersection of the training sample sets between the terminal and the other terminal; and determining the comprehensive gradient based on the parameter update gradients received from other terminals and the corresponding gradient weights.
[0008] Optionally, the method further includes: any terminal determining other designated terminals that need to update gradients through interaction parameters based on the intersection of training sample sets with other terminals; the gradient update through interaction parameters between different terminals includes: gradient update through interaction parameters between any terminal and the determined other designated terminals.
[0009] Optionally, the method further includes: the central terminal acquiring sample identification information of training samples in the training sample set for different terminals, and determining the intersection of training sample sets between different terminals based on the sample identification information.
[0010] Optionally, the method further includes: for any sample identification information, the central terminal determines the number of terminals among the N terminals that store the training samples corresponding to the targeted sample identification information, and if the determined number of terminals is less than a preset terminal number threshold, the training samples corresponding to the targeted sample identification information are determined as scarce training samples; for any terminal, the central terminal determines the corresponding model parameter weights based on the scarce training samples stored in the targeted terminal; the step of updating the current model comprehensive parameters by integrating the second model terminal parameters of multiple terminals includes: the central terminal updates the current model comprehensive parameters based on the second model terminal parameters of multiple terminals and the corresponding model parameter weights.
[0011] Optionally, the method further includes: for any sample identification information, the central terminal determines the number of terminals among the N terminals that store the training samples corresponding to the targeted sample identification information, and if the determined number of terminals is less than a preset terminal number threshold, the training samples corresponding to the targeted sample identification information are determined as scarce training samples; for any terminal, the central terminal determines a corresponding first training stopping condition based on the scarce training samples stored in the targeted terminal; and any terminal performs training updates based on the current model comprehensive parameters and the locally stored training sample set to obtain first model terminal parameters, including: any terminal performs training updates based on the current model comprehensive parameters and the locally stored training sample set until the corresponding first training stopping condition is met to obtain the first model terminal parameters.
[0012] Optionally, the interaction of parameter update gradients between different terminals includes: the interaction of parameter update gradient homomorphic ciphertexts obtained by different terminals based on a preset homomorphic encryption algorithm; the determination of a comprehensive gradient by any terminal integrating the parameter update gradients received from other terminals includes: any terminal integrating the parameter update gradient homomorphic ciphertexts received from other terminals to determine a comprehensive gradient homomorphic ciphertext, and determining a comprehensive gradient based on the decryption method corresponding to the preset homomorphic encryption algorithm and the determined comprehensive gradient homomorphic ciphertext.
[0013] The second aspect of this application provides a risk prediction method, comprising: performing risk prediction for a user based on a pre-trained risk prediction model; the training method of the risk prediction model includes: in a distributed system comprising one central terminal and N terminals, the central terminal determines the initial model parameters of the risk prediction model as the current model comprehensive parameters and sends them to the N terminals respectively; N is a positive integer greater than 1; each terminal locally stores a training sample set; the following steps are executed cyclically until a preset training stop condition is met: each terminal, based on the current model comprehensive parameters, performs training and updates according to the locally stored training sample set to obtain first model terminal parameters; different terminals interact to update the parameter gradient; each terminal integrates the received parameter update gradients from other terminals to determine a comprehensive gradient, and updates its own first model terminal parameters according to the determined comprehensive gradient to obtain second model terminal parameters; the central terminal integrates the second model terminal parameters of multiple terminals to determine new current model comprehensive parameters, and sends the new current model comprehensive parameters to the N terminals respectively.
[0014] A third aspect of this application provides a federated learning-based model training device for a distributed system comprising one central terminal and N terminals; where N is a positive integer greater than 1; different terminals store different training sample sets locally; the device comprises: an initialization module, used to call the central terminal to determine the initial model parameters of the model to be trained as the current model composite parameters, and send them to the N terminals respectively; and a looping module, used to repeatedly execute the following steps until a preset training stop condition is met: any terminal updates its training based on the current model composite parameters and the locally stored training sample set to obtain first model terminal parameters; different terminals interact to update the gradient of parameters; any terminal integrates the received parameters from other terminals to update the gradient, determines the composite gradient, and updates its own first model terminal parameters according to the determined composite gradient to obtain second model terminal parameters; the central terminal integrates the second model terminal parameters of multiple terminals, updates the current model composite parameters, and sends the updated current model composite parameters to the N terminals respectively.
[0015] A fourth aspect of this application provides a risk prediction device, comprising: a prediction module for predicting risk for a user based on a pre-trained risk prediction model; the training method of the risk prediction model includes: in a distributed system comprising one central terminal and N terminals, the central terminal determines the initial model parameters of the risk prediction model as the current model comprehensive parameters and sends them to the N terminals respectively; N is a positive integer greater than 1; each terminal locally stores a training sample set; the following steps are executed cyclically until a preset training stop condition is met: each terminal updates its training based on the current model comprehensive parameters and the locally stored training sample set to obtain first model terminal parameters; different terminals interact to update the parameter gradient; each terminal integrates the parameter update gradients received from other terminals to determine a comprehensive gradient, and updates its own first model terminal parameters according to the determined comprehensive gradient to obtain second model terminal parameters; the central terminal integrates the second model terminal parameters of multiple terminals to determine new current model comprehensive parameters, and sends the new current model comprehensive parameters to the N terminals respectively.
[0016] A fifth aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0017] A sixth aspect of this application also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0018] A seventh aspect of this application also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description
[0019] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0020] Figure 1 The illustration shows an application scenario diagram of a model training method based on federated learning according to an embodiment of this application;
[0021] Figure 2 The flowchart illustrating a federated learning-based model training method according to an embodiment of this application is shown in the illustration.
[0022] Figure 3 The diagram schematically illustrates a structural block diagram of a model training apparatus based on federated learning according to an embodiment of this application;
[0023] Figure 4 The diagram illustrates an electronic device suitable for implementing a federated learning-based model training method or a risk prediction method according to embodiments of this application. Detailed Implementation
[0024] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0025] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0026] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0027] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0028] With the popularization of artificial intelligence, various business units have begun to use their own data samples for model training to leverage machine learning models for business operations. Examples include product recommendation, search, and audio / video services. However, if a business unit only uses its own data samples for model training, the sample size is relatively small, and overfitting is likely to occur, resulting in poor model training performance. If multiple business units collaborate on model training, the current common practice is to merge the data samples from each unit for model training, which carries lower data security.
[0029] To address the aforementioned issues, embodiments of this application provide a model training method based on federated learning.
[0030] This method employs federated learning to coordinate model training across multiple business units. Specifically, a central server can be deployed to interact with the model training terminals of each business unit. This interaction can focus solely on model parameters. The central server distributes the initial global model parameters to each business unit's terminal. Each terminal then updates its own data set based on these global parameters, resulting in new model parameters (referred to as terminal model parameters for clarity). These terminal parameters are then sent back to the central server for aggregation, yielding new global model parameters. These new global parameters are then distributed to each business unit's terminal to continue training and updating their own data sets. This process is repeated multiple times to complete the model training. Throughout the overall model training process, each business unit's data samples can be stored locally for local model training, eliminating the need to send local data samples to any other device or party, thus enhancing data security.
[0031] In the above method, the model training terminals of each business unit can use the model parameters aggregated from the central server to reduce overfitting of the model training terminals to local data samples, thereby improving the training effect. Furthermore, during model training, the update gradients of model parameters can be exchanged between different business units for updating the terminal model parameters. This allows for greater utilization of model training information from other business units, further reducing overfitting of the model training terminals to local data samples and improving training effectiveness. Moreover, the exchange of parameter update gradients between business units does not require sending local data samples externally, thus improving data sample security.
[0032] In the above method, any model training terminal can update the gradient using the parameters obtained from other model training terminals and update the local model parameters. This allows for model training by combining the training information from other model training terminals. Introducing the model training information from other model training terminals can reduce overfitting of the model training terminal to local data samples, improve the model training effect, and facilitate faster convergence of the global model, thereby improving the efficiency and convergence speed of model training.
[0033] Understandably, the above method combines the central server's aggregation of terminal model parameters from various training terminals, and utilizes the interaction of parameter update gradients between different training terminals to update the local terminal model parameters. This allows the terminal model parameter updates to incorporate training information from other training terminals, enabling collaborative model training across multiple terminals. Therefore, this method can be considered a complete and indivisible technical solution. Even without each training terminal sharing its local data samples, collaborative training can leverage the training information (aggregated model parameters and parameter update gradients) from other training terminals in various ways. This improves data sample security during model training, reduces overfitting of local data samples, enhances training effectiveness, and increases training efficiency and convergence speed.
[0034] The embodiments of this application are not limited to the models trained by the above methods. Optionally, the above methods can be used to train models such as risk prediction models, product recommendation models, search prediction models, image processing models, audio and video models, etc., in collaboration with multiple business parties.
[0035] In a specific example, multiple business parties can leverage local product data samples and the aforementioned method to collaboratively train a product recommendation model. The trained product recommendation model can then be used to recommend products to users. Therefore, optionally, product recommendations can be made to users based on a pre-trained product recommendation model, which can be pre-trained using a federated learning-based model training method provided in this application's embodiments.
[0036] It should be noted that the federated learning-based model training method and apparatus provided in the embodiments of this application can be applied to the fields of distributed technology and artificial intelligence technology, as well as the fintech field. For example, for different financial institutions or different banks, the federated learning-based model training method provided in the embodiments of this application can be used for model training, specifically for training a risk prediction model to predict user risk. The embodiments of this application can also be applied to any field other than fintech, such as recommendation systems, risk control, image processing, etc. In other fields where multi-party collaborative training is required, the federated learning-based model training method provided in the embodiments of this application can be used for model training. The application fields of the federated learning-based model training method and apparatus provided in the embodiments of this application are not limited.
[0037] In the technical solution of this application, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.
[0038] In scenarios involving automated decision-making using personal information, the methods, devices, and systems provided in this application all offer users corresponding entry points for choosing to agree to or reject the automated decision-making results. If the user chooses to reject, the process proceeds to the expert decision-making stage. Here, "automated decision-making" refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests, or economic, health, and credit status through computer programs, and then making a decision. Here, "expert decision-making" refers to the activity of making decisions by personnel who specialize in a particular field, possess specialized experience, knowledge, and skills, and have reached a certain level of professional expertise.
[0039] Figure 1 The illustration shows an application scenario diagram of a federated learning-based model training method according to an embodiment of this application.
[0040] like Figure 1 As shown, application scenario 100 according to this embodiment may include: a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0041] Different business parties can interact with the server 105 via the network 104 through the first terminal device 101, the second terminal device 102, and the third terminal device 103 respectively, to receive or send messages, etc. Among them, the different terminal devices can belong to different business parties, and the terminal devices can be used for model training and can interact with the server 105 to exchange model parameters.
[0042] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be electronic devices used for model training and interactive model parameters, such as business server devices, business host devices, etc.
[0043] Server 105 can be a server providing various services, such as a central server for coordinating multiple business parties. The central server can aggregate and process the received model parameters, such as calculating statistical values like weighted sums or weighted averages, and then feed back the aggregated global model parameters to each terminal device. Different terminal devices can also interact with each other, specifically through network 104, to exchange parameters, update gradients, and use them for local terminal model training.
[0044] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0045] Figure 2 A flowchart illustrating a federated learning-based model training method according to an embodiment of this application is shown.
[0046] like Figure 2 As shown, the federated learning-based model training method provided in this embodiment may include operations S210 to S220.
[0047] The embodiments of this application do not limit the execution entity of a federated learning-based model training method. Optionally, it can be applied to distributed systems to achieve multi-device collaborative model training.
[0048] The embodiments of this application do not limit the specific architecture of the distributed system. Optionally, the distributed system may include multiple devices to realize multi-terminal collaborative model training, and may include 1 central terminal and N terminals, where N can be a positive integer greater than 1. Different terminals among the N terminals may store different training sample sets locally. In a specific example, different terminals may belong to different business parties, thereby enabling collaborative training among multiple business parties. The embodiments of this application do not limit the specific form of the central terminal and terminals. The central terminal may be any electronic device or any application, specifically a server device or an application deployed on a server, such as a central server or a central service terminal; the terminal may be any electronic device or any application, which can be used for model training. The terminal may store a training sample set locally for local model training, specifically a business party's server or model training terminal or an application deployed on a server, such as a business party's model training terminal or business party's model training device.
[0049] In operation S210, the central terminal determines the initial model parameters of the model to be trained as the current model comprehensive parameters and sends them to N terminals respectively.
[0050] In operation S220, the following steps are executed repeatedly until the preset training stop condition is met: any terminal updates its training based on the current model's integrated parameters and the locally stored training sample set to obtain the first model terminal parameters; different terminals interact to update the gradient of parameters; any terminal integrates the parameters received from other terminals to update the gradient, determines the integrated gradient, and updates its own first model terminal parameters to obtain the second model terminal parameters based on the determined integrated gradient; the central terminal integrates the second model terminal parameters of multiple terminals, updates the current model's integrated parameters, and sends the updated current model's integrated parameters to N terminals respectively.
[0051] This method allows for model training through the interaction of model parameters between the terminal and the central terminal, as well as the interaction between terminals to update gradients. It enables multi-party collaborative model training without the need to send local training sample sets from each terminal to the outside, thereby improving the security of data samples during the model training process.
[0052] This method can also combine model training information from other terminals in various ways to train the model as a whole. This includes updating the model parameters of multiple terminals at the central end, as well as updating the parameter gradients through interaction between different terminals. This can reduce overfitting of terminals to local training sample sets, improve the training effect of the model, and increase the efficiency and convergence speed of model training.
[0053] The embodiments of this application do not limit the specific form of the model to be trained. Optionally, the model to be trained can be a risk prediction model, a product recommendation model, an image processing model, etc. The model obtained by the federated learning-based model training method provided in the embodiments of this application can be used to execute corresponding business operations. For example, a product recommendation model can be trained based on the above method flow, and then the trained product recommendation model can be used to recommend products to users. Since multiple training sample sets are used for training during the training process, the training effect of the product recommendation model can be improved, thereby improving the accuracy and effectiveness of product recommendations and enhancing the user's experience with product recommendations.
[0054] For ease of understanding, in one optional embodiment, the model to be trained can be a risk prediction model. Specifically, it can predict user risk, such as default risk, behavioral risk, payment risk, or transfer risk, which can help reduce user risk and improve user experience and security.
[0055] Therefore, optionally, embodiments of this application may also provide a risk prediction method, wherein risk prediction can be performed on a user based on a pre-trained risk prediction model. The risk prediction model can be trained using a federated learning-based model training method provided in embodiments of this application, thereby improving the training effect of the risk prediction model, enhancing the accuracy and effectiveness of risk prediction, and improving the user's experience with risk prediction.
[0056] Optionally, the training method for the risk prediction model may include: in a distributed system comprising one central terminal and N terminals, the central terminal determines the initial model parameters of the risk prediction model as the current model comprehensive parameters and sends them to the N terminals respectively; N is a positive integer greater than 1; each terminal locally stores a training sample set; the following steps are executed cyclically until a preset training stopping condition is met: each terminal updates its training based on the current model comprehensive parameters and the locally stored training sample set to obtain the first model terminal parameters; different terminals interact to update the gradient of parameters; each terminal integrates the received parameters from other terminals to update the gradient, determines the comprehensive gradient, and updates its own first model terminal parameters according to the determined comprehensive gradient to obtain the second model terminal parameters; the central terminal integrates the second model terminal parameters of multiple terminals to determine the new current model comprehensive parameters, and sends the new current model comprehensive parameters to the N terminals respectively.
[0057] The embodiments of this application do not limit the specific training method of the risk prediction model. For a detailed explanation, please refer to the explanation of the federated learning-based model training method provided in the embodiments of this application. The model training method embodiments provided in this application can be used to train risk prediction models. It is understood that by using the federated learning-based model training method provided in the embodiments of this application to train risk prediction models, the training effect of risk prediction models can be improved, the security of sample data during the training process of risk prediction models can be improved, the accuracy and effectiveness of risk prediction can be improved, the user experience of risk prediction can be improved, user risk can be reduced more easily, and user experience and security can be improved.
[0058] The embodiments of this application do not limit the specific method of interaction between the central terminal and the terminal for model parameters. Optionally, encrypted transmission can be used to improve the security of the model parameters.
[0059] Optionally, the central terminal can encrypt and transmit the current model's integrated parameters to N terminals; each of the N terminals can encrypt and transmit its trained model terminal parameters to the central terminal. Specifically, public-private key pairs can be used for encryption. For example, the central terminal can encrypt the current model's integrated parameters using the public key of any terminal, and the terminal can decrypt them using its own private key, thus improving data transmission security. Alternatively, any terminal can encrypt its model terminal parameters using the central terminal's public key, and the central terminal can decrypt them using its own private key.
[0060] The embodiments of this application do not limit the specific method of encrypted transmission. Optionally, homomorphic encryption can be used for encrypted transmission. Optionally, N terminals can each homomorphically encrypt the trained model terminal parameters to obtain homomorphic ciphertext of the model terminal parameters, and transmit it to the central terminal. Due to the characteristics of homomorphic encryption, operations can be performed in ciphertext form, allowing the central terminal to directly synthesize the homomorphic ciphertext of multiple model terminal parameters without decrypting the homomorphic ciphertext, obtain the homomorphic ciphertext of the current model synthesis parameters, and send the current model synthesis parameters homomorphic ciphertext to the N terminals respectively, where each terminal decrypts it to obtain the current model synthesis parameters. Using homomorphic encryption allows the central terminal to avoid knowing the plaintext of the model terminal parameters, and also avoid knowing the plaintext of the model synthesis parameters, which can further improve the data security of the model parameters. Specific homomorphic encryption algorithms can include threshold homomorphic encryption algorithms, etc.
[0061] Accordingly, for the parameter update gradient between different terminals, encrypted transmission can also be used to improve the security of the parameter update gradient. The embodiments of this application do not limit the specific method of parameter update gradient interaction between terminals, nor do they limit the specific method and process of encrypted transmission of parameter update gradient. For detailed explanations, please refer to other embodiments.
[0062] Optionally, different terminals can use public-private key pairs for encrypted transmission, or they can use homomorphic encryption algorithms for encrypted transmission. Optionally, the interaction of parameter update gradients between different terminals can specifically include: the interaction of homomorphic ciphertext of parameter update gradients obtained based on a preset homomorphic encryption algorithm between different terminals. Different terminals can directly decrypt the homomorphic ciphertext of the parameter update gradient to obtain the parameter update gradient, or they can utilize the characteristics of homomorphic encryption to use the homomorphic ciphertext for synthesis in the subsequent determination of the comprehensive gradient. Therefore, optionally, any terminal synthesizes the parameter update gradients received from other terminals to determine the comprehensive gradient. Specifically, this can include: any terminal synthesizing the homomorphic ciphertext of the parameter update gradients received from other terminals to determine the homomorphic ciphertext of the comprehensive gradient, and determining the comprehensive gradient based on the decryption method corresponding to the preset homomorphic encryption algorithm and the determined homomorphic ciphertext of the comprehensive gradient. This embodiment can determine the comprehensive gradient through homomorphic encryption during the interaction of gradients between different terminals, eliminating the need to determine the plaintext of the parameter update gradient to obtain the plaintext of the comprehensive gradient, thereby improving the security of the parameter update gradient.
[0063] The embodiments of this application are not limited to a preset homomorphic encryption algorithm, but may specifically be a threshold homomorphic encryption algorithm.
[0064] The embodiments of this application do not limit the specific decryption process. Optionally, the terminal itself can have the ability to decrypt homomorphic ciphertext. For example, different terminals can agree on the same homomorphic encryption method and basis, enabling them to decrypt the exchanged homomorphic ciphertext. Different terminals can also decrypt homomorphic ciphertext through interaction. For example, any terminal may receive different parameter update gradient homomorphic ciphertexts from other terminals, which may be obtained using the same homomorphic encryption method. These other terminals can have the ability to decrypt homomorphic ciphertexts, and can thus feed back the comprehensive gradient homomorphic ciphertext to other terminals for decryption, obtaining the comprehensive gradient plaintext fed back to the terminal. Since the comprehensive gradient does not contain the parameter update gradients of other terminals, it is not necessary to determine the parameter update gradient plaintext of other terminals, thus improving the security of the parameter update gradient.
[0065] Regarding the interactive loop steps between the central terminal and N terminals, the embodiments of this application do not limit the preset training stopping condition. Optionally, the preset training stopping condition may be that the number of loops is greater than a preset loop number threshold, or that the loss determined based on the current model's comprehensive parameters is less than a preset loss threshold, or that the accuracy of the current model's comprehensive parameters in the test sample set is higher than a preset accuracy threshold, etc.
[0066] Understandably, once the preset training stopping conditions are met, model training can be considered complete. The current combined parameters of the model can then be determined as the training result, resulting in the trained model used to execute corresponding business operations. Optionally, upon completion of training, the central terminal can send the current combined model parameters to N terminals for use. Specifically, each terminal's respective business entity can obtain the trained model.
[0067] The embodiments of this application do not limit the process for determining the terminal parameters of the first model.
[0068] Optionally, each of the N terminals can train the model based on the current model's comprehensive parameters, update the model parameters, and obtain the first model terminal parameters.
[0069] The embodiments of this application do not limit the specific model training process of the terminal. Optionally, different terminals can use the same model training method and process, and train based on different training sample sets. Specifically, they can use the same model loss function and the same terminal training stopping condition. For a detailed explanation of the terminal training stopping condition, please refer to other embodiments, such as the number of iterations required during terminal training. Of course, different terminals can also use different model training methods and processes, specifically different model loss functions and different terminal training stopping conditions.
[0070] Optionally, during the process of updating the terminal parameters of the first model during terminal training, the degree of difference between the terminal parameters of the model and the current comprehensive parameters of the model can be used as one of the losses for training. Training and updating can be carried out in order to reduce the degree of difference between the terminal parameters of the model and the current comprehensive parameters of the model, thereby making it easier to reduce the deviation from the current comprehensive parameters of the model, facilitating model convergence, and improving model training efficiency and convergence speed.
[0071] The embodiments of this application do not limit the process for determining the terminal parameters of the second model.
[0072] Optionally, for any terminal, after updating the gradients of interaction parameters between different terminals, the gradients of parameters from other terminals received can be combined to determine the comprehensive gradient. Then, the first model terminal parameters are updated based on the comprehensive gradient to obtain the second model terminal parameters. This embodiment does not limit the specific process and method of updating the gradients of interaction parameters between different terminals, nor does it limit the number of gradients received from other terminals. Specifically, the comprehensive gradient can be determined by combining the gradients of parameters from one or more other terminals received. It is understood that the first model terminal parameters can be directly updated based on the comprehensive gradient, specifically by combining information such as the update step size for model parameter updates.
[0073] The embodiments of this application do not limit the specific process of determining the first model terminal parameters and the second model terminal parameters of any terminal. It is understood that the process of determining the first model terminal parameters and the second model terminal parameters can be executed cyclically. Determining the second model terminal parameters after the loop stops can improve the training effect of the model on the terminal side and improve the efficiency and convergence speed of model training.
[0074] Therefore, optionally, any terminal may repeatedly execute the following steps to determine the second model terminal parameters until a preset loop stopping condition is met: based on the current model composite parameters, train and update according to the locally stored training sample set to obtain the first model terminal parameters; interact with each other to update the gradient of parameters; synthesize the gradient updates of parameters received from other terminals to determine the composite gradient, and update its own first model terminal parameters according to the determined composite gradient to obtain the second model terminal parameters, and determine the second model terminal parameters as the new current model composite parameters. The explanation of the preset loop stopping condition can refer to the explanation of other stopping conditions, specifically, for example, the number of loops is greater than a preset loop number threshold, or the loss based on the current second model terminal parameters is less than a preset loss threshold.
[0075] The embodiments of this application do not limit the specific method and process of updating gradients through interaction parameters between different terminals. Optionally, the gradient can be updated through random interaction parameters between different terminals, or each terminal can update the gradient for interaction parameters with all other terminals, or any terminal can update the gradient for interaction parameters with a selected subset of other terminals. The embodiments of this application do not limit the number of terminals that interact to update gradients. Optionally, all N terminals may need to interact with other terminals to update gradients, or they may interact with one or more other terminals; or one or more terminals may need to interact with other terminals to update gradients. It is understood that interacting to update gradients through interaction parameters between any two different terminals can reduce overfitting of terminals to the local training sample set, improve the training effect of the model, and improve the efficiency and convergence speed of model training.
[0076] The embodiments of this application do not limit the specific way in which the terminal selects other terminals that need to update the gradient with interactive parameters. Optionally, any terminal may randomly select other terminals to update the gradient with interactive parameters, or it may select based on the model training information of other terminals. For example, it may select other terminals whose current model training loss is less than a preset loss threshold to update the gradient with interactive parameters, or it may select based on the distribution of training samples of other terminals. For example, it may select other terminals whose number of training samples is greater than a preset sample number threshold to update the gradient with interactive parameters.
[0077] The embodiments of this application do not limit the specific method for determining the parameter update gradients interacting between different terminals. Optionally, the interaction may involve using the parameter update gradients from the process of determining the parameters of the first model terminal, or it may involve determining the current parameter update gradients based on the first model terminal parameters and further using the local training sample set of the terminal.
[0078] It is understood that, in one optional embodiment, the process of exchanging parameter update gradients between different terminals may include the following steps: any terminal determines other terminals that need to exchange parameter update gradients; any terminal determines the parameter update gradients that need to be exchanged; any terminal sends the determined parameter update gradients to the determined other terminals. It is understood that different terminals may execute the above steps separately to achieve the exchange of parameter update gradients between different terminals.
[0079] In one optional embodiment, when specifically determining the parameter update gradient that needs to be interacted with, the intersection of the training sample sets can be determined for other terminals that need to interact. Thus, the parameter update gradient that needs to be interacted with can be determined based on the training samples in the intersection, that is, the training samples stored by both terminals. This makes it convenient to determine and interact with the parameter update gradient based on the same training samples, which can improve the model training effect.
[0080] Therefore, optionally, the interaction of parameter update gradients between different terminals can specifically include: any terminal, for any other terminal, determining the intersection of its training sample set with that other terminal, and based on its own first model terminal parameters, determining the parameter update gradient according to the training samples in the determined intersection, and sending the determined parameter update gradient to the other terminal. This embodiment can determine the parameter update gradient and interact based on the intersection of training sample sets between different terminals. This allows different terminals to determine the parameter update gradient and interact when the training samples are the same, reducing the possibility of overfitting in the local model training of the terminal, improving model training performance, and increasing model convergence speed.
[0081] Understandably, when determining the parameter update gradient for interaction, each terminal can first identify the other terminals that need to be interacted with, and further determine the intersection of the training sample sets to determine the parameter update gradients that need to be interacted with. Specifically, when the same terminal determines the parameter update gradients for different other terminals, it can determine different intersections and thus determine different parameter update gradients for separate interactions.
[0082] The embodiments of this application are not limited to the specific method of determining the parameter update gradient based on the intersection of training sample sets. Optionally, the loss value can be determined based on the first model terminal parameters, according to the training samples in the intersection, and the corresponding parameter update gradient can be determined according to the loss function and the loss value.
[0083] The embodiments of this application do not limit the specific method for determining the intersection of training sample sets. Optionally, it may be based on the identification information of training samples exchanged between different terminals to determine whether there are training samples with the same identification information. This eliminates the need to exchange training samples or send training sample data to other terminals, improving the data security of training samples. Only insensitive identification information needs to be exchanged to determine the intersection of training sample sets. In a specific example, a hash value can be determined for the identifier in the training sample, which can further improve the desensitization effect. The intersection of training sample sets is determined by comparing the hash values of the identifiers of the training samples. It is understood that based on the same identification information determined after interaction, different terminals can easily determine the intersection of their local training sample sets.
[0084] In one alternative embodiment, when specifically selecting other terminals that need to update gradients using interactive parameters, the selection can also be made by combining the intersection of the training sample sets.
[0085] Optionally, the above method may further include: any terminal determining other designated terminals that need to update gradients through interaction parameters based on the intersection of training sample sets with other terminals; the interaction parameter update gradient between different terminals may specifically include: interaction parameter update gradient between any terminal and the determined other designated terminals. This embodiment can select some other terminals to update gradients through interaction parameters based on the intersection of training sample sets, which can easily reduce the number of other terminals that need to update gradients through interaction parameters, thus improving the efficiency and accuracy of gradient updates for other terminals.
[0086] It is understandable that each terminal can select other designated terminals that need to interact with gradients from N-1 other terminals, and can interact with gradients with the selected other designated terminals.
[0087] The embodiments of this application do not limit the specific method of determining other designated terminals based on the intersection of training sample sets. Optionally, other designated terminals can be determined based on information such as the number and proportion of training samples in the intersection of training sample sets with other terminals. Specifically, any terminal can determine other designated terminals whose number of training samples in the intersection of training sample sets is greater than a preset upper limit threshold; or it can determine other designated terminals whose number of training samples in the intersection of training sample sets is less than a preset lower limit threshold. It is understood that interacting with other terminals with a larger number of training samples in the intersection to update gradients facilitates model training and parameter updates based on more identical samples, improving the convergence speed and effectiveness of model training; interacting with other terminals with a smaller number of training samples in the intersection facilitates model training and parameter updates based on more diverse samples, allowing for the use of more comprehensive training samples, improving the comprehensiveness and effectiveness of model training. Therefore, determining other designated terminals based on the intersection allows for the selection of other designated terminals to interact with based on the similarities and differences in training samples between different terminals, improving the effectiveness of model training. Of course, it is understandable that different implementations of selecting other designated terminals can be combined with each other. For example, other terminals with fewer training samples in the intersection and other terminals with more training samples in the intersection can both be identified as other designated terminals.
[0088] Alternatively, other designated terminals can be determined based on the proportion of training samples in the intersection set. For a detailed explanation, please refer to other embodiments. Optionally, the proportion of training samples in the intersection set can be the proportion of the number of training samples in the intersection set within the training sample sets of the terminal or other terminals, or it can be the proportion of the number of training samples in the intersection set within the total number of training samples from the two terminals. Accordingly, other designated terminals can be determined based on whether the proportion of training samples in the intersection set is greater than or less than a threshold.
[0089] The embodiments of this application do not limit the specific method of determining the comprehensive gradient.
[0090] Optionally, any terminal can receive parameter update gradients sent by one or more other terminals. Specifically, it can calculate statistical values such as the mean, weighted sum, and weighted mean of the received parameter update gradients to obtain a comprehensive gradient. Accordingly, the embodiments of this application do not limit the specific method of determining the weights of the parameter update gradient. Optionally, the gradient weights of other terminals can be determined through normalization or other methods based on the model training information of other terminals, such as the current model loss and the number of samples in the training sample set. This allows the comprehensive gradient to be determined by combining the received parameter update gradients with the corresponding gradient weights.
[0091] In one optional embodiment, the intersection of training sample sets between different terminals can be combined to determine the corresponding gradient weights, which are then used to determine the comprehensive gradient. It is understood that determining gradient weights based on the similarities and differences in training samples between different terminals facilitates the determination of the parameter update gradients of other terminals that the comprehensive gradient should favor. Specifically, other terminals with more identical samples can be selected, and the parameter update gradient can be given more weight when determining the comprehensive gradient. This facilitates model training and parameter updates based on more identical samples, improving the convergence speed and effectiveness of model training. Alternatively, other terminals with more differing samples can be selected, and the parameter update gradient can be given more weight when determining the comprehensive gradient. This facilitates model training and parameter updates based on more differing samples, allowing for the use of more comprehensive training samples, thus improving the comprehensiveness and effectiveness of model training.
[0092] Therefore, optionally, any terminal can determine the comprehensive gradient by integrating the parameter update gradients received from other terminals. Specifically, this can include: any terminal updating the gradient for any other terminal with which it is targeting interaction parameters, determining the corresponding gradient weights based on the intersection of the training sample sets with the other terminal; and determining the comprehensive gradient based on the parameter update gradients received from other terminals and the corresponding gradient weights. This embodiment can determine the gradient weights corresponding to other terminals based on the intersection of the training sample sets, and combine the gradient weights to determine the comprehensive gradient, which can improve the comprehensiveness and accuracy of the comprehensive gradient, and improve the model training effect and convergence speed.
[0093] It is understandable that each terminal can determine the corresponding gradient weights for other terminals, which will be used to determine the overall gradient later.
[0094] The embodiments of this application do not limit the specific method of determining gradient weights based on the intersection of training sample sets. Optionally, the gradient weights corresponding to other terminals can be determined based on information such as the number and proportion of training samples in the intersection of training sample sets with other terminals. Accordingly, the comprehensive gradient is determined based on the updated gradients and corresponding gradient weights of the parameters received from other terminals. Specifically, this can be done by: updating the gradients and corresponding gradient weights of the parameters received from other terminals, and determining the comprehensive gradient as the weighted sum or weighted mean of the updated gradients.
[0095] Optionally, the number of training samples in the intersection can be positively correlated with the gradient weights, or negatively correlated with the gradient weights. Optionally, the proportion of training samples in the intersection can be positively correlated with the gradient weights, or negatively correlated with the gradient weights. Optionally, the proportion of training samples in the intersection can be the proportion of the number of training samples in the intersection within the training sample set of the terminal or other terminals, or the proportion of the number of training samples in the intersection within the total number of training samples of the two terminals. For a more detailed explanation, please refer to other embodiments.
[0096] The embodiments of this application do not limit the specific method for determining the intersection of training sample sets. In one optional embodiment, the intersection of training sample sets can be determined based on sample identifiers between different terminals, or the central terminal can aggregate the training sample identifier information of multiple terminals to determine the intersection of training sample sets between any two different terminals as a whole. Of course, the intersection of training sample sets between different terminals can also be determined in advance, specifically before the model begins training.
[0097] Therefore, optionally, the above method may further include: the central terminal acquiring sample identification information of training samples in the training sample set for different terminals, and determining the intersection of training sample sets between different terminals based on the sample identification information. In this embodiment, the central terminal can determine the intersection of training sample sets between different terminals based on the sample identification information. The central terminal can summarize and compare the overall sample identification information, improving the efficiency and accuracy of determining the intersection of training sample sets. Furthermore, since the intersection is determined based on the sample identification information, the training samples themselves do not need to be sent out, thereby improving the data security of the training samples.
[0098] The embodiments of this application do not limit the sample identification information. Optionally, it can be the primary key information or user identifier in the training samples, which can be used to determine different training samples belonging to the same user. In a specific example, the same user can correspond to different user samples in different business units, thereby determining different user samples of the same user based on the user identifier. It is understood that the same sample can be a sample with the same identifier but different characteristics, or it can be a sample with the same identifier and the same characteristics. Optionally, the sample identification information can also be a hash value specifying the sample information, which can facilitate comparison based on the hash value and improve the data security of the samples.
[0099] Optionally, the central terminal can obtain the identification information of training samples from N terminals to determine the intersection of the training sample sets. Specifically, for the training sample identification information of any terminal, the central terminal can traverse the other N-1 terminals to find the same training sample identification information, thereby determining the intersection of samples between terminals, specifically determining the intersection of sample identifications between terminals.
[0100] Optionally, the sample identifier intersection determined by the central terminal may include training sample identifier information but not training samples. When determining the sample identifier intersection, the central terminal can, for any given terminal, feed back the N-1 sample identifier intersections (which may include the same training sample identifier information) between that terminal and N-1 other terminals. This allows the terminal to easily determine the specific intersection of its training sample set with the N-1 other terminals (including local training samples) based on the training sample identifier information.
[0101] Optionally, after obtaining the sample identification information of the training samples in the training sample sets of different terminals, the central terminal can further determine the distribution of the training samples in different terminals. For example, it can determine whether the same training sample is stored repeatedly in different terminals, thereby easily determining the number of terminals storing any training sample and the scarcity of training samples.
[0102] Therefore, optionally, the central terminal can determine the number of terminals storing the training samples corresponding to the targeted sample identification information among N terminals for any given sample identification information. If the determined number of terminals is less than a preset terminal number threshold, the training samples corresponding to the targeted sample identification information are designated as scarce training samples. The embodiments of this application do not limit the specific usage of scarce training samples. Optionally, weights can be determined based on scarce training samples for model training.
[0103] Optionally, the gradient weights for other terminals in other embodiments can be determined based on the number or proportion of scarce training samples, or used to select other terminals that need to interact with the gradient. For a detailed explanation, please refer to other embodiments.
[0104] Regarding the operation of updating the current model's integrated parameters by integrating the parameters of the second model terminals from multiple terminals at the central end, the embodiments of this application do not limit the specific method of integrating the parameters of multiple second model terminals.
[0105] Optionally, statistical values such as the mean, weighted sum, and weighted mean of the second model terminal parameters across multiple terminals can be used to determine the new comprehensive parameters of the current model. This updates the comprehensive parameters of the current model. The updated comprehensive parameters are then sent to N terminals, and the above process is repeated to train the model. The method for determining the weights of the second model terminal parameters is not limited; they can be determined based on the number of training samples or the loss of each terminal.
[0106] Optionally, the central terminal can acquire second model terminal parameters from multiple terminals, or it can receive second model terminal parameters sent by multiple terminals. Any terminal or all terminals can send the second model terminal parameters to the central terminal upon receiving them. The embodiments of this application do not limit the number of second model terminal parameters determined by the central terminal; the central terminal can update the current model synthesis parameters by integrating the second model terminal parameters from N terminals, or it can update the current model synthesis parameters by integrating the second model terminal parameters from a portion of the N terminals. It is understood that in a single interaction loop between the central terminal and N terminals, the central terminal can select all or some terminals for model parameter synthesis, for example, by filtering based on the current loss of a terminal or the number of training samples for a terminal, or by randomly selecting terminals, etc.
[0107] In one alternative embodiment, the terminal can be selected for model parameter synthesis based on the scarce training samples stored in the terminal, or the parameter weights corresponding to the parameters of the second model terminal can be determined.
[0108] Optionally, the central terminal can select a specific terminal to update the current model's overall parameters based on the number or proportion of scarce training samples stored in the terminal. This allows the central terminal to integrate the second model terminal parameters from multiple specified terminals and update the current model's overall parameters.
[0109] Optionally, the above method may further include: for any sample identification information, the central terminal determines the number of terminals among N terminals that store the training samples corresponding to the targeted sample identification information, and if the determined number of terminals is less than a preset terminal number threshold, the training samples corresponding to the targeted sample identification information are determined as scarce training samples. For any given terminal, the central terminal determines the corresponding model parameter weights based on the scarce training samples stored in the targeted terminal. Accordingly, the current model comprehensive parameters are updated by combining the second model terminal parameters from multiple terminals. Specifically, this may include: the central terminal updating the current model comprehensive parameters based on the second model terminal parameters from multiple terminals and the corresponding model parameter weights. This embodiment can determine the parameter weights when comprehensive model parameters based on scarce training samples, which can improve the effectiveness and comprehensiveness of model training from the perspective of sample scarcity.
[0110] This application does not limit the specific method for determining the corresponding model parameter weights based on scarce training samples. Optionally, the corresponding model parameter weights can be determined based on the number or proportion of scarce training samples stored on the target terminal. The more scarce training samples there are, the more model parameter weights can be assigned, and the number or proportion of scarce training samples can be positively correlated with the corresponding model parameter weights. It is understood that by giving greater consideration to model parameters with more scarce training samples, the comprehensiveness of model training can be improved, the influence of scarce training samples on model training can be increased, and thus the model training effect can be improved.
[0111] In one optional embodiment, the local model training method for terminals with a larger number of scarce training samples can be adjusted accordingly for the sake of scarce training samples. It is understood that for terminals with a larger number of scarce training samples, more training can be performed to better learn and utilize the scarce training samples, thereby improving the effectiveness and comprehensiveness of model training.
[0112] Therefore, optionally, the above method flow may further include: for any sample identification information, the central terminal determines the number of terminals storing the training samples corresponding to the targeted sample identification information among N terminals, and if the determined number of terminals is less than a preset terminal number threshold, the training samples corresponding to the targeted sample identification information are determined as scarce training samples; for any terminal, the central terminal determines the corresponding first training stopping condition based on the scarce training samples stored in the targeted terminal. Each terminal, based on the current model comprehensive parameters, performs training updates according to the locally stored training sample set to obtain the first model terminal parameters. Specifically, this may include: each terminal, based on the current model comprehensive parameters, performs training updates according to the locally stored training sample set until the corresponding first training stopping condition is met, thus obtaining the first model terminal parameters. This embodiment can adjust the model training method of the corresponding terminal according to the scarce training samples, and can determine the degree of model training of the terminal from the perspective of sample scarcity, thereby improving the effectiveness and comprehensiveness of model training.
[0113] The embodiments of this application do not limit the first training stopping condition, nor do they limit the specific method of determining the corresponding first training stopping condition based on the scarce training samples stored in the target terminal. Optionally, for terminals with a large number of scarce training samples, the degree of model training can be increased to perform more model training, so as to better learn and utilize the scarce training samples and improve the effectiveness and comprehensiveness of model training. Therefore, the first training stopping condition may optionally include stopping training when the number of training loops exceeds a first loop threshold, and obtaining the first model terminal parameters. Correspondingly, the number or proportion of scarce training samples may be positively correlated with the first loop threshold. Other forms of the first training stopping condition can be found in the explanations of other embodiments.
[0114] For ease of understanding, this application also provides an application embodiment.
[0115] In today's rapidly developing information age, the amount of data generated by enterprises and institutions such as banks is increasing daily, and this data can be used to train machine learning models. The acquisition of data and the use of data to train models are both performed with authorization and in compliance with regulations; specifically, data can be acquired and used to train models only with user authorization. To improve the effectiveness of model applications, enterprises can negotiate to share data for training. However, enterprises do not want to provide their data to other enterprises, which leads to the problem of data silos.
[0116] To address the data silo problem, this embodiment designs a bank federated learning model based on homomorphic encryption. It employs different clients from multiple financial institutions (corresponding to multiple terminals in the above method embodiment) to collaboratively train the model. Model parameters are transmitted using homomorphic encryption, ensuring that data from each participant is not leaked externally and is centrally used for training locally. This model not only guarantees data security for each participant but also improves the model accuracy for all participants. Furthermore, it is applicable to various machine learning tasks, as long as all participants use the same model.
[0117] This embodiment does not limit the specific models trained by the multiple participants. For ease of understanding, this embodiment provides a specific example, which could be a risk prediction model that can predict user risks, such as default risk. Of course, other models can also be trained, such as image processing models, etc.
[0118] This embodiment provides a federated learning model based on homomorphic encryption. The method design is shown below.
[0119] (1) To address the issue of poor model training performance using datasets from individual participants, and to avoid directly merging datasets from various participants for model training, this embodiment employs a federated averaging method. This method eliminates the need to merge data from each participant; each participant trains its own model locally using its own data. The interaction between participants utilizes model parameters, thus improving data security while achieving the same results as training with merged data. The design philosophy of federated averaging is that multiple clients use their local model parameters as interaction information between each client to train a global model. This embodiment designs different clients from multiple institutions to perform federated learning, with each institution's client possessing its own local dataset.
[0120] In a practical application scenario, suppose there are M clients participating in the training. The specific algorithm flow is as follows: First, the server initializes a global model parameter and distributes this global model parameter to each client. Each client has its local dataset. After obtaining the global model, each client performs local model training and updates. After the update, each client receives new model parameters. Specifically, each client can design its own loss function for local model training and updates. Then, the updated parameters from each client are uploaded to the server for weighted averaging, completing the model parameter aggregation and obtaining the new global model parameter. Afterward, the entire process can be executed iteratively based on the new global model parameter until the global model converges.
[0121] (2) Since this embodiment uses model parameters as the interaction information for each client, the model parameters on the server side can be in plaintext form. To improve the security of the model parameters and prevent them from being leaked on the server side, this embodiment can use homomorphic encryption technology for the model parameters. Homomorphic encryption is a special encryption method that allows users to perform calculations on encrypted data, and the result obtained after decryption is the same as the result of performing the same calculation on the original data. The key feature of this encryption technology is that it supports operations on ciphertext without decryption, thereby improving data security.
[0122] Homomorphic encryption primarily involves several key steps: 1. Key Generation: The key generation function, run by each participant, generates a key for encrypting the data. This includes a public key and a private key pair. The public key is used for data encryption, and the private key is used to decrypt the computation result. 2. Encryption: The encryption function, run by each participant, uses the generated public key to encrypt the original data (plaintext), generating encrypted data (ciphertext). This step enhances data security; even if the data is intercepted during transmission, it cannot be deciphered without the corresponding key. 3. Computation: The evaluation function, run by the party performing the computation (server), operates on the ciphertext under a given data processing method. A key feature of homomorphic encryption is that it allows computation on the ciphertext without prior decryption. After the computation is complete, a new ciphertext containing the result of the computation on the original data is obtained. 4. Decryption: The decryption function, run by each participant, uses the private key to decrypt the computed ciphertext, obtaining the computation result. Decryption is the final step in homomorphic encryption, revealing the result of the encrypted data processing and further enhancing data security.
[0123] Fully homomorphic encryption is a type of homomorphic encryption algorithm that supports an arbitrary number of computations. This embodiment can employ a fully homomorphic encryption algorithm. The implementation involves each client holding a public and private key pair. The client encrypts the model parameters after each training iteration and uploads all encrypted model parameters to the server. The server aggregates (sums and averages) the encrypted model parameters and sends the result (ciphertext) to each client. The client uses its private key to decrypt the ciphertext to obtain the plaintext. The client then continues training using the plaintext, iterating this process until each client's model converges.
[0124] Of course, other homomorphic encryption algorithms can also be used, such as threshold homomorphic encryption. Specifically, multiple clients generate public and private keys through secure multi-party computation, then split the private key into multiple private key fragments. Each client can hold a portion of the private key fragment, enough to decrypt the content encrypted with the public key. Then, the client can use the public key to homomorphically encrypt the locally trained model parameters. After the server performs global parameter aggregation, the client can decrypt the data using the private key fragments it holds to obtain the new global model parameters.
[0125] This embodiment designs one server and several clients. Each client uses a fully connected network. The overall algorithm flow is shown below.
[0126] Step 1: Initialize model parameters and keys. The server initializes model parameters and then sends them to the clients. The public key is jointly generated by k financial institutions through secure multi-party computation, and the private key is split into k fragments and stored in each client.
[0127] Step 2: Sample Identifier Alignment. Before federated learning begins, the intersection of samples between any two clients is calculated through coordination by the central server. Each client can perform salted hashing on its local sample identifiers to obtain a hashed set of sample identifiers. Clients can use a globally random salt value generated and broadcast to other clients by the central server.
[0128] The central server collects the hashed sample identifiers from all clients and calculates the intersection of any two clients. The intersection is the set of hash values of the sample identifiers, identifying the common sample set among different clients.
[0129] The central server sends the intersection of sample identifiers between different clients to each client respectively. It can be understood that the intersection of sample identifiers contains the identifiers of the same samples between these two clients. The client can determine the intersection of the original samples based on the intersection of sample identifiers, which is then used for subsequent model training.
[0130] Step 3: The client selects the gradient interaction object. After receiving the intersection of model parameters and sample identifiers, the client first calculates the intersection ratio between the local client and other clients. The client can select the interaction object according to preset strategies: Strategy 1: Select other clients whose sample intersection ratio in the local sample set is higher than a threshold. Strategy 2: Select other clients whose sample intersection ratio in the local sample set is lower than a threshold. Strategy 3: All clients interact with each other.
[0131] Step 4: Local Training and Model Update. The client trains and updates the model parameters based on the local dataset, obtaining the local model parameters. A proximate term can be added to the loss function to constrain the deviation between the local model and the global model, improving convergence stability in data-skewed scenarios.
[0132] Step 5: The client can homomorphically encrypt the gradient of the local model to obtain the encrypted gradient, specifically the gradient of the loss function at the current local model parameters. After obtaining the encrypted gradient, according to the preset strategy in Step 3, the client selects an interaction object and distributes it to other clients. When calculating the gradient, for any other client, the corresponding sample intersection can be determined (this can be determined based on the intersection of corresponding sample identifiers), and the gradient of the loss function is determined based on the determined sample intersection.
[0133] Step 6: Gradient Aggregation and Model Update. After receiving encrypted gradients from other clients, the client can perform weighted aggregation in encrypted form. The gradient weights can be determined based on the number of overlapping samples or their proportion in the total number of samples from both clients. The client can decrypt the aggregated gradient using its private key. After decryption, the local model parameters are updated based on the aggregated gradient.
[0134] Step 7: Multiple rounds of training after model update. Using the updated local model parameters, multiple rounds of training can be performed based on the intersection of the local dataset and samples to obtain the latest local model parameters. The central server can identify scarce samples based on the collected sample identifier hash values, and thus determine the number of training iterations for each client based on the number or proportion of scarce samples. For example, if a client has a large proportion of scarce samples, it indicates that the samples in that client are relatively scarce, and multiple rounds of training can be performed to better utilize the scarce samples.
[0135] Understandably, steps five, six, and seven can be executed repeatedly until the client model converges.
[0136] Step 8: The central server can obtain the local model parameters from the client, aggregate them to obtain new global model parameters, and then send the new global model parameters to the client. Continue to execute step 4 and subsequent steps in a loop until the global model converges.
[0137] The beneficial effects of this embodiment include at least the following: (1) By adopting the federated learning concept, the same effect as training with fused data can be achieved without the client disclosing its own data. This keeps the client's information locally and improves data security. (2) The model parameters are exchanged using homomorphic encryption technology. Even if the data is intercepted during the upload and download process, the encrypted parameters cannot be decrypted, thus ensuring security. (3) This design has strong applicability and can be applied as long as the client's model structure is consistent.
[0138] Corresponding to the above method embodiments, this application also provides a model training device based on federated learning. The following will combine... Figure 3 The device is described in detail.
[0139] Figure 3 The diagram illustrates a structural block diagram of a federated learning-based model training apparatus according to an embodiment of this application.
[0140] like Figure 3 As shown, this embodiment provides a federated learning-based model training device 300, which includes an initialization module 310 and a recurrent module 320. This device can be applied to a distributed system containing one central endpoint and N terminals; N is a positive integer greater than 1; different terminals store different training sample sets locally.
[0141] The initialization module 310 is used to call the central terminal to determine the initial model parameters of the model to be trained as the current model synthesis parameters, and send them to N terminals respectively. In one embodiment, the initialization module 310 can be used to execute the operation S210 described above and related operations, which will not be repeated here.
[0142] The loop module 320 is used to repeatedly execute the following steps until a preset training stop condition is met: Each terminal updates its training based on the current model's integrated parameters and the locally stored training sample set to obtain first model terminal parameters; different terminals interact to update the gradient of parameters; each terminal integrates the received parameters from other terminals to update the gradient, determines the integrated gradient, and updates its own first model terminal parameters to obtain second model terminal parameters based on the determined integrated gradient; the central terminal integrates the second model terminal parameters from multiple terminals, updates the current model's integrated parameters, and sends the updated current model's integrated parameters to N terminals respectively. In one embodiment, the loop module 320 can be used to execute the operation S220 described above and related operations, which will not be repeated here.
[0143] In this embodiment of the device, the initial module 310 and the loop module 320 can call the central end or the terminal to perform corresponding operations, or control the central end or the terminal to perform corresponding operations.
[0144] Optionally, the loop module 320 can be specifically used for: any terminal to any other terminal, to determine the intersection of the training sample sets between itself and the other terminal, and based on its own first model terminal parameters, to determine the parameter update gradient according to the training samples in the determined intersection, and to send the determined parameter update gradient to the other terminal.
[0145] Optionally, the loop module 320 can be specifically used for: any other terminal updating the gradient for any terminal in response to the interaction parameters, determining the corresponding gradient weight based on the intersection of the training sample sets between the terminal and the other terminal; and determining the comprehensive gradient based on the received gradient updates from the other terminal's parameters and the corresponding gradient weights.
[0146] Optionally, the loop module 320 is further configured to: determine other designated terminals that need to update gradients by interaction parameters based on the intersection of training sample sets between any terminal and other terminals; specifically, the loop module 320 can be configured to: update gradients by interaction parameters between any terminal and the determined other designated terminals.
[0147] Optionally, the loop module 320 is also used for: the central end to obtain the sample identification information of the training samples in the training sample set for different terminals, and to determine the intersection of the training sample sets between different terminals based on the sample identification information.
[0148] Optionally, the loop module 320 is further configured to: for any sample identification information, determine the number of terminals among N terminals that store the training samples corresponding to the targeted sample identification information, and if the determined number of terminals is less than a preset terminal number threshold, determine the training samples corresponding to the targeted sample identification information as scarce training samples; for any terminal, determine the corresponding model parameter weights based on the scarce training samples stored in the targeted terminal; specifically, the loop module 320 is configured to: update the current model comprehensive parameters based on the second model terminal parameters of multiple terminals and the corresponding model parameter weights.
[0149] Optionally, the loop module 320 is further configured to: for any sample identification information, determine the number of terminals storing the training samples corresponding to the targeted sample identification information among N terminals, and if the determined number of terminals is less than a preset terminal number threshold, determine the training samples corresponding to the targeted sample identification information as scarce training samples; for any terminal, determine the corresponding first training stopping condition based on the scarce training samples stored in the targeted terminal; specifically, the loop module 320 is configured to: for any terminal, perform training updates based on the current model comprehensive parameters and the locally stored training sample set until the corresponding first training stopping condition is met, and obtain the first model terminal parameters.
[0150] Optionally, the loop module 320 is specifically used for: the interaction between different terminals to update the gradient homomorphic ciphertext based on the parameters obtained by the preset homomorphic encryption algorithm; any terminal to comprehensively receive the parameters from other terminals to update the gradient homomorphic ciphertext, determine the comprehensive gradient homomorphic ciphertext, and determine the comprehensive gradient based on the decryption method corresponding to the preset homomorphic encryption algorithm and the determined comprehensive gradient homomorphic ciphertext.
[0151] According to embodiments of this application, any plurality of modules in the initial module 310 and the loop module 320 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules can be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of this application, at least one of the initial module 310 and the loop module 320 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the initial module 310 and the loop module 320 can be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.
[0152] For an explanation of this device embodiment, please refer to other embodiments. Each embodiment in the above method embodiment can be executed by the corresponding module in this device embodiment.
[0153] Corresponding to the above method embodiments, this application also provides a risk prediction device. This device may include: a prediction module, used to perform risk prediction for a user based on a pre-trained risk prediction model. The training method of the risk prediction model may include: in a distributed system comprising one central terminal and N terminals, the central terminal determines the initial model parameters of the risk prediction model as the current model comprehensive parameters and sends them to the N terminals respectively; N is a positive integer greater than 1; each terminal locally stores a training sample set; the following steps are executed cyclically until a preset training stop condition is met: each terminal, based on the current model comprehensive parameters, updates its training according to the locally stored training sample set to obtain first model terminal parameters; different terminals interact to update the parameter gradient; each terminal integrates the received parameter update gradients from other terminals to determine a comprehensive gradient, and updates its own first model terminal parameters according to the determined comprehensive gradient to obtain second model terminal parameters; the central terminal integrates the second model terminal parameters of multiple terminals to determine new current model comprehensive parameters, and sends the new current model comprehensive parameters to the N terminals respectively. Further explanation of this device embodiment can be found in other embodiments.
[0154] Figure 4 The diagram illustrates an electronic device suitable for implementing a federated learning-based model training method or a risk prediction method according to embodiments of this application.
[0155] like Figure 4 As shown, an electronic device 900 according to an embodiment of this application includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage portion 908 into a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.
[0156] RAM 903 stores various programs and data required for the operation of electronic device 900. Processor 901, ROM 902, and RAM 903 are interconnected via bus 904. Processor 901 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 902 and / or RAM 903. It should be noted that the programs may also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in the one or more memories, specifically, executing operations performed by a central terminal or any terminal, or executing an embodiment of a risk prediction method.
[0157] According to embodiments of this application, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to a bus 904. The electronic device 900 may also include one or more of the following components connected to the input / output (I / O) interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output (I / O) interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.
[0158] Embodiments of this application provide an electronic device, including: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps executed by any terminal or central terminal in any of the above method embodiments, or to implement an embodiment of the above-described risk prediction method.
[0159] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0160] Embodiments of this application also provide a computer-readable storage medium storing a computer program or instructions thereon, which, when executed by a processor, implement the steps executed by any terminal or central terminal in any of the above method embodiments, or implement an embodiment of the above-described risk prediction method.
[0161] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 902 and / or RAM 903 and / or one or more memories other than ROM 902 and RAM 903 described above.
[0162] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the steps executed by any terminal or central terminal in any method embodiment provided in this application, or to implement an embodiment of the risk prediction method described above.
[0163] Embodiments of this application also provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps executed by any terminal or central terminal in any of the above method embodiments, or implement an embodiment of the above-described risk prediction method.
[0164] When the computer program is executed by the processor 901, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0165] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 909, and / or installed from a removable medium 911. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0166] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, it performs the functions defined in the system of this application embodiment. According to the embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0167] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0168] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0169] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A model training method based on federated learning, characterized in that, This is applied to a distributed system comprising one central terminal and N terminals; where N is a positive integer greater than 1. Different terminals store different training sample sets locally; the method includes: The central terminal determines the initial model parameters of the model to be trained as the current model comprehensive parameters and sends them to the N terminals respectively; Repeat the following steps until the preset training stop condition is met: Each terminal, based on the current model's comprehensive parameters, trains and updates the parameters according to the locally stored training sample set to obtain the first model terminal parameters; different terminals interact to update the gradient of parameters; each terminal integrates the received parameters from other terminals to update the gradient, determines the comprehensive gradient, and updates its own first model terminal parameters according to the determined comprehensive gradient to obtain the second model terminal parameters; the central terminal integrates the second model terminal parameters of multiple terminals, updates the current model's comprehensive parameters, and sends the updated current model's comprehensive parameters to the N terminals respectively.
2. The method according to claim 1, characterized in that, The gradient for updating interaction parameters between different terminals includes: For any other terminal, determine the intersection of the training sample sets between the terminal and the other terminal, and based on its own first model terminal parameters, determine the parameter update gradient according to the training samples in the determined intersection, and send the determined parameter update gradient to the other terminal.
3. The method according to claim 2, characterized in that, The method for any terminal to synthesize the parameter update gradient received from other terminals and determine the comprehensive gradient includes: For any other terminal that updates the gradient for the interaction parameters, the corresponding gradient weight is determined based on the intersection of the training sample sets between the terminal and the other terminal. The gradient is updated based on the parameters received from other terminals, along with the corresponding gradient weights, to determine the overall gradient.
4. The method according to claim 1 or 2, characterized in that, The method further includes: any terminal determining, based on the intersection of the training sample sets with other terminals, other specified terminals that need to update the gradient with interactive parameters; The gradient update of interaction parameters between different terminals includes: the gradient update of interaction parameters between any terminal and other designated terminals.
5. The method according to claim 2, characterized in that, The method further includes: The central terminal obtains the sample identification information of the training samples in the training sample set for different terminals, and determines the intersection of the training sample sets between different terminals based on the sample identification information.
6. The method according to claim 5, characterized in that, The method further includes: For any sample identification information, the central terminal determines the number of terminals among the N terminals that store the training sample corresponding to the targeted sample identification information, and if the determined number of terminals is less than a preset terminal number threshold, the training sample corresponding to the targeted sample identification information is determined as a scarce training sample. For any given terminal, the central terminal determines the corresponding model parameter weights based on the scarce training samples stored in the terminal. The second model terminal parameters, which integrate multiple terminals, are used to update the current model integration parameters, including: The central terminal updates the current model's comprehensive parameters based on the second model terminal parameters of multiple terminals and the corresponding model parameter weights.
7. The method according to claim 5, characterized in that, The method further includes: For any sample identification information, the central terminal determines the number of terminals among the N terminals that store the training sample corresponding to the targeted sample identification information, and if the determined number of terminals is less than a preset terminal number threshold, the training sample corresponding to the targeted sample identification information is determined as a scarce training sample. For any given terminal, the central terminal determines the corresponding first training stop condition based on the scarce training samples stored in the terminal. The terminal, based on the current model's comprehensive parameters, trains and updates the parameters according to the locally stored training sample set to obtain the first model terminal parameters, including: Each terminal, based on the current model's comprehensive parameters, trains and updates according to the locally stored training sample set until the corresponding first training stopping condition is met, thus obtaining the first model terminal parameters.
8. The method according to claim 1, characterized in that, The interaction parameter update gradient between different terminals includes: the interaction between different terminals based on the parameter update gradient homomorphic ciphertext obtained by a preset homomorphic encryption algorithm; The method for any terminal to synthesize the parameter update gradient received from other terminals and determine the comprehensive gradient includes: Any terminal updates the gradient homomorphic ciphertext by integrating the parameters received from other terminals, determines the comprehensive gradient homomorphic ciphertext, and determines the comprehensive gradient based on the decryption method corresponding to the preset homomorphic encryption algorithm and the determined comprehensive gradient homomorphic ciphertext.
9. A risk prediction method, characterized in that, The method includes: Risk prediction is performed on users based on a pre-trained risk prediction model. The training methods for the risk prediction model include: In a distributed system comprising one central terminal and N terminals, the central terminal determines the initial model parameters of the risk prediction model as the current model comprehensive parameters and sends them to the N terminals respectively; N is a positive integer greater than 1; each terminal locally stores a training sample set; the following steps are executed cyclically until a preset training stop condition is met: each terminal updates its training based on the current model comprehensive parameters and the locally stored training sample set to obtain the first model terminal parameters; different terminals interact to update the parameter gradient; each terminal integrates the parameter update gradients received from other terminals to determine the comprehensive gradient, and updates its own first model terminal parameters according to the determined comprehensive gradient to obtain the second model terminal parameters; the central terminal integrates the second model terminal parameters of multiple terminals to determine the new current model comprehensive parameters, and sends the new current model comprehensive parameters to the N terminals respectively.
10. A model training device based on federated learning, characterized in that, This is applied to a distributed system comprising one central terminal and N terminals; where N is a positive integer greater than 1. Different terminals store different training sample sets locally; the device includes: The initial module is used to call the central terminal to determine the initial model parameters of the model to be trained as the current model comprehensive parameters, and send them to the N terminals respectively; The loop module is used to repeatedly execute the following steps until a preset training stop condition is met: any terminal updates its training based on the current model's comprehensive parameters and the locally stored training sample set to obtain the first model terminal parameters; different terminals interact to update the gradient of parameters; any terminal updates the gradient by integrating the parameters received from other terminals, determines the comprehensive gradient, and updates its own first model terminal parameters to obtain the second model terminal parameters based on the determined comprehensive gradient; the central terminal integrates the second model terminal parameters of multiple terminals, updates the current model's comprehensive parameters, and sends the updated current model's comprehensive parameters to the N terminals respectively.
11. A risk prediction device, characterized in that, The device includes: The prediction module is used to make risk predictions for users based on a pre-trained risk prediction model. The training method of the risk prediction model includes: in a distributed system containing one central terminal and N terminals, the central terminal determines the initial model parameters of the risk prediction model as the current model comprehensive parameters and sends them to the N terminals respectively; N is a positive integer greater than 1; each terminal locally stores a training sample set; the following steps are executed cyclically until a preset training stop condition is met: each terminal updates its training based on the current model comprehensive parameters and the locally stored training sample set to obtain the first model terminal parameters; different terminals interact to update the parameter gradient; each terminal integrates the parameter update gradients received from other terminals to determine the comprehensive gradient, and updates its own first model terminal parameters according to the determined comprehensive gradient to obtain the second model terminal parameters; the central terminal integrates the second model terminal parameters of multiple terminals to determine the new current model comprehensive parameters, and sends the new current model comprehensive parameters to the N terminals respectively.
12. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic is that the one or more processors execute the one or more computer programs to implement the steps executed by any terminal or central terminal in the method according to any one of claims 1 to 8, or to implement the steps of the method according to claim 9.
13. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by the processor, they implement the steps of any terminal or central terminal in the method according to any one of claims 1 to 8, or implement the steps of the method according to claim 9.
14. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of any terminal or central terminal in the method according to any one of claims 1 to 8, or implement the steps of the method according to claim 9.