Model parameter updating method, device, equipment, storage medium and program product

By calculating the proximal optimization loss and updating parameters using gradient values, the problem of balancing communication cost and model performance in longitudinal federated learning is solved, achieving the goal of maintaining model prediction accuracy while reducing communication costs.

CN113011603BActive Publication Date: 2025-01-10WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110287041.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-17
Publication Date
2025-01-10
Estimated Expiration
2041-03-17

AI Technical Summary

Technical Problem

In vertical federated learning, existing solutions struggle to balance communication costs and model performance. Too many local iterations by participants lead to parameter distortion, while too few iterations fail to effectively reduce communication costs.

Method used

By calculating the proximal optimization loss, the amount of parameter change in this local iteration is characterized, and the parameters are updated based on the gradient value calculated on the proximal optimization loss and the model output. The proximal optimization loss is increased to constrain the amount of parameter change and avoid parameter distortion.

Benefits of technology

While increasing the number of local iterations, we can reduce communication costs, ensure the model's prediction accuracy, and avoid distortion caused by excessive changes in parameter values.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113011603B_ABST
    Figure CN113011603B_ABST
Patent Text Reader

Abstract

The present invention discloses a model parameter updating method, device, equipment, storage medium and program product, the method comprising: calculating a proximal optimization loss, wherein the proximal optimization loss represents the change in the parameter value of the first model in the first device in the current round of local iteration compared to the parameter value in the local iteration of the preset historical round; based on the proximal optimization loss, the model output of the first model in the current round of local iteration and the longitudinal federation intermediate result received from the second device, calculating the gradient value corresponding to the parameter; and updating the parameter using the gradient value to complete the current round of local iteration. The present invention realizes that while reducing the communication cost by increasing the number of local iterations, the prediction accuracy of the model can also be guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to a model parameter updating method, device, equipment, storage medium and program product. Background Art

[0002] With the development of artificial intelligence, people have proposed the concept of "federated learning" to solve the problem of data silos, so that both parties in the federation can train models to obtain model parameters without providing their own data, and avoid data privacy leakage. Vertical federated learning, when the data features of the participants overlap less and the users overlap more, the users and data with the same participants but different user data features are taken out to jointly train the machine learning model.

[0003] In the process of vertical federated learning, the participant with labeled data needs to communicate with other participants multiple times to transmit the intermediate results required by the other party to update parameters, such as model output or gradient values ​​corresponding to model output. Both parties need to perform multiple rounds of joint parameter updates, which means multiple communications are required, so the communication cost is high. To address this problem, a solution has been proposed in which the participant uses the intermediate results sent by other participants to perform multiple rounds of local iterations locally, reducing the number of joint parameter updates by increasing the number of local iterations, thereby reducing communication costs.

[0004] However, in this scheme, when the number of local iterations of the participants is large, parameter distortion is prone to occur, resulting in the inability to guarantee the performance of the model. When the number of local iterations is small, the communication cost cannot be effectively reduced. Summary of the invention

[0005] The main purpose of the present invention is to provide a model parameter updating method, device, equipment, storage medium and program product, aiming to solve the problem that communication cost and model performance are difficult to balance in current vertical federated learning schemes.

[0006] To achieve the above object, the present invention provides a model parameter updating method, which is applied to a first device participating in vertical federated learning, the first device is communicatively connected with a second device participating in vertical federated learning, and the method comprises the following steps:

[0007] Calculating a proximal optimization loss, wherein the proximal optimization loss represents a change in a parameter value of a parameter of the first model in the first device in the current round of local iterations compared to a parameter value in a local iteration of a preset historical round;

[0008] Calculate a gradient value corresponding to the parameter based on the proximal optimization loss, a model output of the first model in this round of local iteration, and a longitudinal federation intermediate result received from the second device;

[0009] The parameters are updated using the gradient values ​​to complete this round of local iteration.

[0010] Optionally, the step of calculating the proximal optimization loss, wherein the proximal optimization loss characterizes a change in a parameter value of a parameter of the first model in the first device in the current round of local iteration compared to a parameter value in a local iteration of a preset historical round, comprises:

[0011] Subtracting corresponding elements of a parameter vector of the parameters of the first model in the first device in the current round of local iteration from a parameter vector in the local iteration of a preset historical round to obtain a difference vector;

[0012] The sum of squares of the elements in the difference vector is calculated, and the proximal optimization loss is obtained based on the sum of squares.

[0013] Optionally, when the first device is a participant that owns the label data, the vertical federation intermediate result is the output of the model in the second device.

[0014] The step of calculating the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the first model in the current round of local iteration, and the longitudinal federation intermediate result received from the second device comprises:

[0015] Inputting the training data of the first device into the first model in the first device for processing, and obtaining a model output of the first model in this round of local iteration;

[0016] A prediction result is calculated based on the model output and the longitudinal federation intermediate result, and a prediction loss is calculated based on the prediction result and label data corresponding to the training data;

[0017] The prediction loss and the proximal optimization loss are added together to obtain a total loss, and a gradient value corresponding to the parameter is calculated based on the total loss.

[0018] Optionally, when the second device is a participant with label data, the vertical federation intermediate result is a gradient value of the prediction loss in the second device relative to the output of the first model sent by the first device during the current round of joint parameter update.

[0019] The step of calculating the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the model in the current round of local iteration, and the longitudinal federation intermediate result received from the second device comprises:

[0020] Inputting the training data of the first device into the first model of the first device for processing, to obtain a model output of the first model in this round of local iteration;

[0021] Calculate a first sub-gradient value of the predicted loss relative to the parameter according to the model output and the longitudinal federation intermediate result;

[0022] A second sub-gradient value of the proximal optimization loss relative to the parameter is calculated, and the first sub-gradient value and the second sub-gradient value are added to obtain a gradient value corresponding to the parameter.

[0023] Optionally, the step of adding the first sub-gradient value and the second sub-gradient value to obtain the gradient value corresponding to the parameter includes:

[0024] The second sub-gradient value is multiplied by a preset adjustment coefficient and then added to the first sub-gradient value to obtain a gradient value corresponding to the parameter.

[0025] To achieve the above object, the present invention provides a user risk prediction method, which is applied to a first device participating in vertical federated learning, the first device is communicatively connected with a second device participating in vertical federated learning, and the method comprises the following steps:

[0026] Based on the proximal optimization loss, the local risk prediction model is obtained by jointly performing longitudinal federated learning with the second device, wherein the proximal optimization loss represents the change in the parameter value of the parameter of the model to be trained at the local end in the current local iteration compared with the parameter value in the local iteration of the preset historical round;

[0027] The local risk prediction model is used to predict the risk value of the user to be predicted.

[0028] Optionally, the step of performing longitudinal federated learning with the second device based on the proximal optimization loss to obtain a local risk prediction model includes:

[0029] receiving a longitudinal federation intermediate result of this round of joint parameter update sent by the second device;

[0030] Based on the proximal optimization loss and the longitudinal federation intermediate result, the parameters in the local end to-be-trained model are locally iterated and updated for a preset number of rounds;

[0031] Check whether the model to be trained on the local end after updating the parameters meets the preset model conditions;

[0032] If satisfied, the local model to be trained after updating the parameters is used as the local risk prediction model;

[0033] If not satisfied, return to the step of receiving the longitudinal federation intermediate result of this round of joint parameter update sent by the second device.

[0034] Optionally, the step of performing a preset number of local iterative updates on the parameters in the local end to-be-trained model based on the proximal optimization loss and the longitudinal federation intermediate result comprises:

[0035] Calculate the proximal optimization loss, and calculate the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the local to-be-trained model in this round of local iteration, and the longitudinal federation intermediate result;

[0036] Using the gradient value to update the parameter to complete this round of local iteration;

[0037] Check whether the number of local iteration rounds reaches the preset number of rounds;

[0038] If so, the step of detecting whether the model to be trained on the local end after updating the parameters meets the preset model condition is executed;

[0039] If not reached, the step of calculating the proximal optimization loss is returned to execute, and the number of local iteration rounds is increased by 1.

[0040] To achieve the above object, the present invention provides a model parameter updating device, which is deployed on a first device participating in vertical federated learning, the first device is communicatively connected with a second device participating in vertical federated learning, and the device comprises:

[0041] A first calculation module, configured to calculate a proximal optimization loss, wherein the proximal optimization loss represents a change in a parameter value of a parameter of a first model in the first device in the current round of local iterations compared to a parameter value in a local iteration of a preset historical round;

[0042] A second calculation module, configured to calculate a gradient value corresponding to the parameter based on the proximal optimization loss, a model output of the first model in this round of local iteration, and a longitudinal federation intermediate result received from the second device;

[0043] An updating module is used to update the parameters using the gradient value to complete this round of local iteration.

[0044] To achieve the above object, the present invention provides a user risk prediction device, which is deployed on a first device participating in vertical federated learning, the first device is communicatively connected with a second device participating in vertical federated learning, and the device includes:

[0045] A federated learning module, configured to perform longitudinal federated learning with the second device based on a proximal optimization loss to obtain a local risk prediction model, wherein the proximal optimization loss represents a change in a parameter value of a local model to be trained in the current local iteration compared to a parameter value in a local iteration of a preset historical round;

[0046] The prediction module is used to use the local risk prediction model to predict the risk value of the user to be predicted.

[0047] To achieve the above-mentioned purpose, the present invention also provides a model parameter updating device, which includes: a memory, a processor, and a model parameter updating program stored in the memory and executable on the processor, and the model parameter updating program implements the steps of the model parameter updating method described above when executed by the processor.

[0048] To achieve the above-mentioned purpose, the present invention also provides a user risk prediction device, which includes: a memory, a processor, and a user risk prediction program stored in the memory and executable on the processor, and the user risk prediction program, when executed by the processor, implements the steps of the user risk prediction method described above.

[0049] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer-readable storage medium, on which a model parameter updating program is stored, and when the model parameter updating program is executed by a processor, the steps of the model parameter updating method as described above are implemented.

[0050] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer-readable storage medium, on which a user risk prediction program is stored, and when the user risk prediction program is executed by a processor, the steps of the user risk prediction method as described above are implemented.

[0051] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the model parameter updating method described above are implemented.

[0052] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer program product, including a computer program, which implements the steps of the user risk prediction method as described above when executed by a processor.

[0053] Compared with the existing solutions, in the present invention, when the first device participating in vertical federated learning performs local iteration, it adds the calculation of the proximal optimization loss that can characterize the change of the parameter value of the first model in the first device in this round of local iteration compared to the parameter value in the local iteration of the preset historical round, and calculates the gradient value corresponding to the parameter in the first model based on the proximal optimization loss, the model output of the first model in this round of local iteration, and the vertical federated intermediate result received from the second device, and updates the parameters according to the gradient value, that is, increases the proximal optimization loss to constrain the change of the parameters of the first model in the local iteration, thereby avoiding distortion caused by excessive change of parameter values ​​during local iteration, thereby achieving the goal of reducing communication costs by increasing the number of local iterations while ensuring the prediction accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 A schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention;

[0055] Figure 2 It is a flowchart of the first embodiment of the model parameter updating method of the present invention;

[0056] Figure 3 A schematic diagram of a participant performing joint parameter update in an embodiment of the present invention;

[0057] Figure 4 A hardware architecture diagram of a first device and a second device performing vertical federated learning according to an embodiment of the present invention;

[0058] Figure 5 A schematic diagram of an interaction process of performing multiple rounds of joint parameter updates between a first device and a second device according to an embodiment of the present invention;

[0059] Figure 6 It is a functional schematic module diagram of a preferred embodiment of the model parameter updating device of the present invention.

[0060] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0061] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0062] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.

[0063] It should be noted that the model parameter updating device in the embodiment of the present invention may be a smart phone, a personal computer, a server or other device, and no specific limitation is made here. The model parameter updating device may be the first device participating in vertical federated learning.

[0064] like Figure 1 As shown, the model parameter updating device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0065] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation on the model parameter updating device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0066] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a model parameter update program. The operating system is a program that manages and controls the hardware and software resources of the device, and supports the operation of the model parameter update program and other software or programs. Figure 1 In the device shown, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing a communication connection with the second device participating in the vertical federated learning; the processor 1001 can be used to call the model parameter update program stored in the memory 1005, and perform the following operations:

[0067] Calculating a proximal optimization loss, wherein the proximal optimization loss represents a change in a parameter value of a parameter of the first model in the first device in the current round of local iterations compared to a parameter value in a local iteration of a preset historical round;

[0068] Calculate a gradient value corresponding to the parameter based on the proximal optimization loss, a model output of the first model in this round of local iteration, and a longitudinal federation intermediate result received from the second device;

[0069] The parameters are updated using the gradient values ​​to complete this round of local iteration.

[0070] Further, the step of calculating the proximal optimization loss, wherein the proximal optimization loss characterizes a change in a parameter value of a parameter of the first model in the first device in the current round of local iteration compared to a parameter value in a local iteration of a preset historical round, includes:

[0071] Subtracting corresponding elements of a parameter vector of the parameters of the first model in the first device in the current round of local iteration from a parameter vector in the local iteration of a preset historical round to obtain a difference vector;

[0072] The sum of squares of the elements in the difference vector is calculated, and the proximal optimization loss is obtained based on the sum of squares.

[0073] Furthermore, when the first device is a participant that owns the label data, the vertical federation intermediate result is the output of the model in the second device.

[0074] The step of calculating the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the first model in the current round of local iteration, and the longitudinal federation intermediate result received from the second device comprises:

[0075] Inputting the training data of the first device into the first model in the first device for processing, and obtaining a model output of the first model in this round of local iteration;

[0076] A prediction result is calculated based on the model output and the longitudinal federation intermediate result, and a prediction loss is calculated based on the prediction result and label data corresponding to the training data;

[0077] The prediction loss and the proximal optimization loss are added together to obtain a total loss, and a gradient value corresponding to the parameter is calculated based on the total loss.

[0078] Further, when the second device is a participant with label data, the vertical federation intermediate result is a gradient value of the prediction loss in the second device relative to the output of the first model sent by the first device during the current round of joint parameter update,

[0079] The step of calculating the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the model in the current round of local iteration, and the longitudinal federation intermediate result received from the second device comprises:

[0080] Inputting the training data of the first device into the first model of the first device for processing, to obtain a model output of the first model in this round of local iteration;

[0081] Calculate a first sub-gradient value of the predicted loss relative to the parameter according to the model output and the longitudinal federation intermediate result;

[0082] A second sub-gradient value of the proximal optimization loss relative to the parameter is calculated, and the first sub-gradient value and the second sub-gradient value are added to obtain a gradient value corresponding to the parameter.

[0083] Further, the step of adding the first sub-gradient value and the second sub-gradient value to obtain the gradient value corresponding to the parameter includes:

[0084] The second sub-gradient value is multiplied by a preset adjustment coefficient and then added to the first sub-gradient value to obtain a gradient value corresponding to the parameter.

[0085] The embodiment of the present invention further proposes a user risk prediction device, which is a first device participating in vertical federated learning, and the first device establishes a communication connection with a second device participating in vertical federated learning. The user risk prediction device includes: a memory, a processor, and a user risk prediction program stored in the memory and executable on the processor. When the user risk prediction program is executed by the processor, the following steps are implemented:

[0086] Based on the proximal optimization loss, the local risk prediction model is obtained by jointly performing longitudinal federated learning with the second device, wherein the proximal optimization loss represents the change in the parameter value of the parameter of the model to be trained at the local end in the current local iteration compared with the parameter value in the local iteration of the preset historical round;

[0087] The local risk prediction model is used to predict the risk value of the user to be predicted.

[0088] Furthermore, the step of performing longitudinal federated learning with the second device based on the proximal optimization loss to obtain a local risk prediction model includes:

[0089] receiving a longitudinal federation intermediate result of this round of joint parameter update sent by the second device;

[0090] Based on the proximal optimization loss and the longitudinal federation intermediate result, the parameters in the local end to-be-trained model are locally iterated and updated for a preset number of rounds;

[0091] Check whether the model to be trained on the local end after updating the parameters meets the preset model conditions;

[0092] If satisfied, the local model to be trained after updating the parameters is used as the local risk prediction model;

[0093] If not satisfied, return to the step of receiving the longitudinal federation intermediate result of this round of joint parameter update sent by the second device.

[0094] Furthermore, the step of performing a preset number of local iterative updates on the parameters in the local to-be-trained model based on the proximal optimization loss and the longitudinal federation intermediate result includes:

[0095] Calculate the proximal optimization loss, and calculate the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the local to-be-trained model in this round of local iteration, and the longitudinal federation intermediate result;

[0096] Using the gradient value to update the parameter to complete this round of local iteration;

[0097] Check whether the number of local iteration rounds reaches the preset number of rounds;

[0098] If so, the step of detecting whether the model to be trained on the local end after updating the parameters meets the preset model condition is executed;

[0099] If not reached, the step of calculating the proximal optimization loss is returned to execute, and the number of local iteration rounds is increased by 1.

[0100] Based on the above structure, various embodiments of the model parameter updating method are proposed.

[0101] Reference Figure 2 , Figure 2 : This is a flow chart of the first embodiment of the model parameter updating method of the present invention. It should be noted that although the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than here. The model parameter updating method of the present invention is applied to a first device participating in vertical federated learning, and the first device is communicatively connected with a second device participating in vertical federated learning. The first device and the second device may be devices such as smart phones, personal computers, and servers. In this embodiment, the model parameter updating method includes:

[0102] Step S10, calculating a proximal optimization loss, wherein the proximal optimization loss represents a change in a parameter value of a parameter of the first model in the first device in the current round of local iteration compared to a parameter value in a local iteration of a preset historical round;

[0103] In this embodiment, the participants in vertical federated learning are divided into two categories, one is the data application participant with labeled data, and the other is the data provider participant without labeled data. Generally, there is one data application participant and one or more data provider participants. Each participant is deployed with a data set and a machine learning model built based on their own data features. The machine learning models of each participant are combined to form a complete model for completing model tasks such as prediction or classification. Among them, the sample dimensions of the data sets of each participant are aligned, that is, the sample IDs of each data set are the same, but the data features of each participant may be different. Each participant can use encrypted sample alignment in advance to construct a data set with aligned sample dimensions, which will not be described in detail here.

[0104] The machine learning model deployed by the participants can be a common machine learning model, such as a linear regression model, a neural network model, etc., or a model used in automatic machine learning, such as a search network. The search network refers to a network used for model parameter update (NAS); the search network includes multiple units, each unit corresponds to a network layer, and some units are set with connection operations. Taking two units as an example, the connection operation between the two units can be N pre-set connection operations, and the weight corresponding to each connection operation is defined. The weight is the structural parameter of the search network, and the network layer parameters in the unit are the model parameters of the search network; during the model training process, the model parameters need to be updated to optimize the updated structural parameters and model parameters. Based on the final updated structural parameters, the final network structure can be determined, that is, which connection operation or operations to retain can be determined. Since the structure of the network is determined after the network search, each participant does not need to set the network structure of the model like designing a traditional vertical federated learning model, thereby reducing the difficulty of designing the model.

[0105] In this embodiment, the first device may be a data application participant with label data, and the corresponding second device is a data provider participant without label data, and there may be multiple second devices; or the first device may be a data provider participant without label data, and the corresponding second device is a data application participant with label data. Without distinction, the model in the first device is referred to as the first model, and the model in the second device is referred to as the second model.

[0106] The parameters of the model in each participant are initialized in advance, and each participant performs multiple rounds of joint parameter updates to continuously update the parameters in their respective models and improve the performance of the entire model, such as prediction accuracy. When the model of each participant is an ordinary machine learning model, the parameters updated in each round of joint parameter update are model parameters, such as weight parameters in a neural network. When the model of each participant is a search network, the parameters updated in each round of joint parameter update may be structural parameters and / or model parameters. Specifically, in this embodiment, the order of updating structural parameters and model parameters is not limited. For example, the structural parameters may be updated in the first few rounds of joint parameter updates, and the model parameters may be updated in the next few rounds of joint parameter updates. For another example, the structural parameters and model parameters may be updated together in each round of joint parameter update.

[0107] In the process of a round of joint parameter update, each participant first interacts with the intermediate results used to update the parameters in their respective models (hereinafter also referred to as vertical federated intermediate results); each participant performs multiple rounds of local iterations locally based on the received intermediate results, and after the local iterations, performs the next round of joint parameter update. That is, in a round of joint parameter update, a participant only receives the intermediate result sent by other participants once, and the subsequent multiple rounds of local iterations all use the intermediate result to participate in the calculation. Among them, the intermediate result can be a gradient or the output of a model. Specifically, when a participant is a data provider, the intermediate result sent to the other party can be the output of the model in the participant; when a participant is a data application participant, the intermediate result sent to the other party can be the calculated gradient corresponding to the output of the model sent by the data provider. Since what is transmitted is the intermediate result instead of the original data in the data set, the data privacy of each participant is not disclosed to each other, thereby protecting the data security of each participant. Figure 3 FIG. 1 is a schematic diagram of a joint parameter update performed by the participants in an embodiment, wherein Party K is a data application participant, Party 1 to Party K-1 are data providing participants, and Net K It is a model deployed in data application participants. j It is the model deployed in the data provider. c It is deployed by the data application participants to calculate the prediction results based on the output of each party's model (Y out ) model, N j is the output of the model, is the gradient value corresponding to the model output.

[0108] When the first device performs a round of local iteration, the proximal optimization loss can be calculated. The proximal optimization loss can characterize the amount of change between the parameter value of the first model in the current round of local iteration and the parameter value in the local iteration of the preset historical round. By minimizing the proximal optimization loss, the change range of the parameter value of the first model in the current round of local iteration can be constrained compared with the previous historical parameter value, that is, the parameter value of the first model changes less in the current round of local iteration, thereby avoiding the distortion of the parameter value after performing more rounds of local iterations. In this embodiment, there is no restriction on the calculation method of the proximal optimization loss, and there is no restriction on the method for minimizing the proximal optimization loss. For example, in one embodiment, the proximal optimization loss can be used as a loss function, and the proximal optimization loss can be minimized by minimizing the loss function. For example, the gradient value of the proximal optimization loss relative to the parameter in the first model is calculated by a gradient descent algorithm, and the parameters are optimized according to the gradient value, thereby achieving the purpose of minimizing the proximal optimization loss. In other embodiments, other methods may be used to minimize the proximal optimization loss, for example, by randomly changing the parameter values ​​of the parameters in the first model, calculating whether the proximal loss function becomes smaller, and randomly testing to obtain the parameter values ​​that minimize the proximal optimization loss.

[0109] The preset historical round may be a round pre-set in the first device, which is earlier than the round of the current round of local iterations. For example, if the current round of local iterations is the tth round, the preset historical round is less than t. In a round of joint parameter update, the preset historical round may be fixed, that is, each round of local iterations in the round of joint parameter update calculates the proximal optimization loss based on the parameter value at the local iteration of the same historical round. For example, the preset historical round is fixedly set to 1 to ensure that the parameter value at each subsequent round of local iterations has a smaller change than the parameter value at the first round of local iterations. Alternatively, in a round of joint parameter update, the preset historical rounds may not be fixed, that is, different preset historical rounds may be set for each round of local iterations in the round of joint parameter update; when the historical preset rounds are set separately for each round of local iterations, if the proximal optimization loss is calculated based on the previous round of local iterations of the current round of local iterations, the gradient value of the parameter calculated based on the proximal optimization loss may be 0, that is, the proximal optimization loss does not play a constraining role. Therefore, in a preferred embodiment, for all or part of the rounds of local iterations, the round of the local iteration minus the corresponding preset historical round should be greater than 1. It should be noted that in some embodiments, the first device may not calculate the proximal optimization loss for each round of local iterations. For example, there is no local iteration of the historical rounds in the first round of local iterations, so there is no need to calculate the proximal optimization loss.

[0110] Furthermore, in one embodiment, step S10 includes:

[0111] Step S101, subtracting corresponding elements of a parameter vector of a first model in the first device in the current round of local iteration from a parameter vector in a preset historical round of local iteration to obtain a difference vector;

[0112] Step S102, calculating the sum of squares of the elements in the difference vector, and obtaining the proximal optimization loss based on the sum of squares.

[0113] The first model has multiple parameters, which can be expressed in the form of vectors. The first device can subtract the corresponding elements of the parameter vector of the first model in the current round of local iteration from the parameter vector in the local iteration of the preset historical round to obtain a difference vector composed of various difference values, and then calculate the sum of the squares of each element in the difference vector. The first device can use the sum of squares directly as the proximal optimization loss, or calculate the square root of the sum of squares as the proximal optimization loss. It should be noted that in the process of calculating the proximal optimization loss, the first device uses each element of the parameter vector in the current round of local iteration as an unknown variable to participate in the calculation.

[0114] In other implementations, the first device may also use other calculation methods capable of calculating the change between vectors to calculate the proximal optimization loss.

[0115] Step S20, calculating a gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the first model in this round of local iteration, and the longitudinal federation intermediate result received from the second device;

[0116] The first device inputs the training data in the data set into the first model, obtains the model output after being processed by the first model, and calculates the gradient value corresponding to each parameter in the first model according to the proximal optimization loss, the model output and the longitudinal federation intermediate result received from the second device. Among them, the longitudinal federation intermediate result received from the second device is the intermediate result sent by the second device during the current round of joint parameter update. Specifically, when the first device is a data application participant with label data, the longitudinal federation intermediate result is the output of the second model sent by the second device, and the first device can calculate the prediction loss according to the longitudinal federation intermediate result and the model output in this round of local iteration; in one embodiment, the first device can add the proximal optimization loss and the prediction loss to obtain a total loss, and then calculate the gradient value of the total loss relative to the parameters in the first model; in another embodiment, the first device calculates the gradient values ​​of the proximal optimization loss and the prediction loss relative to the parameters in the first model respectively, and adds the two gradient values ​​to obtain the final gradient value. When the first device is a data provider without labeled data, and the second device is a data application participant with labeled data, the vertical federation intermediate result is the gradient value of the prediction loss calculated by the second device relative to the output of the first model; the first device can calculate the gradient value of the prediction loss relative to the parameters in the first model based on the vertical federation intermediate result and the model output in this round of local iteration, and then calculate the gradient value of the proximal optimization loss relative to the parameters in the first model, and add the two gradient values ​​to obtain the final gradient value. It should be noted that in each embodiment of the present invention, the method for calculating the gradient value based on the loss can refer to the existing gradient calculation method, and will not be described in detail.

[0117] Step S30: using the gradient value to update the parameter to complete this round of local iteration.

[0118] After calculating the gradient values ​​of each parameter in the first model, the first device uses each gradient value to update each parameter. That is, each parameter corresponds to a gradient value, and the first device uses the gradient value corresponding to the parameter to update the parameter. Specifically, the first device can add the parameter value of the parameter after the last round of local iteration update plus the gradient value corresponding to the parameter multiplied by the learning rate to obtain the parameter value of the parameter after the current round of local iteration update. After updating each parameter, this round of local iteration is completed. By adding the proximal optimization loss when calculating the gradient value of the parameter, and then updating the parameter according to the gradient value, the parameter can be changed in the direction of minimizing the proximal optimization loss, thereby constraining the change in the parameter and avoiding distortion due to excessive changes in the parameter value.

[0119] Furthermore, after completing the current round of local iterations, if the first device detects that the number of local iterations for the current round of joint parameter update has been reached, the next round of joint parameter update may be performed; if it detects that the number of local iterations for the current round of joint parameter update has not been reached, the next round of local iterations may be performed. In one embodiment, a maximum number of rounds for joint parameter update may be set, and when the number of rounds is reached, the first device stops updating the model parameters. Or, in another embodiment, the first device may detect whether the prediction loss converges after a round of joint parameter update or after a round of local iterations, and if so, stop updating the parameters. After stopping updating the parameters, the first device uses the current parameter value as the final parameter value of the first model. After determining the parameter value of the first model, the first model may be used to complete the prediction task.

[0120] like Figure 4 The figure shows a hardware architecture diagram of a first device and a second device participating in vertical federated learning in one implementation. The first device and the second device exchange intermediate results, and based on the intermediate results sent by the other party, each device performs multiple rounds of local iterations locally. During each round of local iterations, the proximal optimization loss is increased to constrain the change in parameters and avoid distortion due to excessive changes in parameter values.

[0121] Compared with the existing scheme, in this embodiment, when the first device participating in the vertical federated learning performs local iteration, it adds the calculation of the proximal optimization loss that can characterize the change of the parameter value of the first model in the first device in this round of local iteration compared with the parameter value in the local iteration of the preset historical round, and calculates the gradient value corresponding to the parameter in the first model based on the proximal optimization loss, the model output of the first model in this round of local iteration, and the vertical federated intermediate result received from the second device, and updates the parameters according to the gradient value, that is, increases the proximal optimization loss to constrain the change of the parameters of the first model in the local iteration, thereby avoiding distortion caused by excessive change of parameter values ​​during local iteration, thereby achieving the goal of reducing communication costs by increasing the number of local iterations while ensuring the prediction accuracy of the model.

[0122] Further, based on the above first embodiment, a second embodiment of the model parameter updating method of the present invention is proposed. In this embodiment, when the first device is a participant with label data, the vertical federation intermediate result is the output of the model in the second device, and the step S20 includes:

[0123] Step S201, inputting the training data of the first device into the first model in the first device for processing, and obtaining the model output of the first model in this round of local iteration;

[0124] In this embodiment, when the first device is a data application participant with labeled data and the second device is a data provider participant without labeled data, the intermediate result of the vertical federated learning is the output obtained by inputting its training data into the second model for processing in the second device during the current round of joint parameter update. In a local iteration of the current round of joint parameter update, the first device can input its training data into the first model for processing to obtain the model output of the first model in the current round of local iteration.

[0125] Step S202, calculating a prediction result according to the model output and the longitudinal federation intermediate result, and calculating a prediction loss based on the prediction result and label data corresponding to the training data;

[0126] The first device calculates the prediction result based on the model output and the longitudinal federated intermediate result, and calculates the prediction loss based on the prediction result and the label data corresponding to the training data. Specifically, the prediction result is calculated differently depending on the type of machine learning model; for example, when the machine learning model of longitudinal federated learning is a linear regression model, the first device adds the model output and the longitudinal federated intermediate result to obtain the prediction result; for another example, when the machine learning model of longitudinal federated learning is a neural network model, the first model in the first device includes the following: Figure 3 The Net shown K and Net c Two parts, the first device inputs the training data into the Net of the first model K Part of it is processed to get the model output N K , and then N K and the vertical federation intermediate result N j Input to Net c Part of it is processed to get the prediction result Y out .

[0127] The first device calculates the prediction loss according to the prediction result and the label data corresponding to the training data. The prediction loss can be calculated using a commonly used loss function calculation method, such as a cross entropy loss function. Different loss functions can be used depending on the machine learning model being trained.

[0128] Step S203: Add the prediction loss and the proximal optimization loss to obtain a total loss, and calculate the gradient value corresponding to the parameter based on the total loss.

[0129] The first device adds the prediction loss and the proximal optimization loss to obtain a total loss. Specifically, the first device may add the two losses directly or perform a weighted sum of the two losses, and the weights of the two losses may be set as needed. In one embodiment, the first device may add the prediction loss plus the product of the proximal optimization loss and an adjustment coefficient to obtain a total loss, wherein the adjustment coefficient may be pre-set and flexibly adjusted during each round of local iterations. For example, in a round of joint parameter updates, the adjustment coefficient may be initialized to 0.1 and then increased as the number of local iterations increases, so as to achieve a greater constraint on the amount of change in the parameter as the number of local iterations increases. The first device calculates the gradient value corresponding to the parameter based on the total loss, and the specific calculation process is not described in detail here.

[0130] Furthermore, in other embodiments, after calculating the prediction loss and the proximal optimization loss, the first device can calculate the gradient value of the prediction loss relative to the parameters of the first model, and then calculate the gradient value of the proximal optimization loss relative to the parameters of the first model, and then add the two gradient values, or perform weighted summation, to obtain the gradient value corresponding to the parameter.

[0131] like Figure 5 , which is a schematic diagram of an interaction process in which a first device and a second device jointly perform multiple rounds of joint parameter updates in one implementation.

[0132] In this embodiment, the first device calculates the gradient value corresponding to the parameter of the first model through the prediction loss and the proximal optimization loss, and then updates the parameter according to the gradient value, thereby updating the parameter in the direction of minimizing the prediction loss and the proximal optimization loss. This not only improves the prediction accuracy of the model, but also constrains the change in the parameter, avoiding distortion due to excessive parameter changes. Therefore, while reducing the communication cost by increasing the number of local iterations, the prediction accuracy of the model can also be guaranteed.

[0133] Further, based on the above-mentioned first and / or second embodiments, a third embodiment of the model parameter updating method of the present invention is proposed. In this embodiment, when the second device is a participant with label data, the vertical federation intermediate result is a gradient value of the output of the first model sent by the first device during the current round of joint parameter update relative to the prediction loss in the second device, and the step S20 includes:

[0134] Step S204, inputting the training data of the first device into the first model of the first device for processing, and obtaining the model output of the first model in this round of local iteration;

[0135] In this embodiment, when the first device is a data provider without labeled data and the second device is a data application participant with labeled data, in this round of joint parameter update, the first device inputs the training data into the first model for processing to obtain an output, and sends the output as an intermediate result to the second device. The second device calculates the gradient value of the prediction loss corresponding to the output and sends it to the first device as an intermediate result. The intermediate result is the vertical federated intermediate result. In a local iteration of this round of joint parameter update, the first device can input its training data into the first model for processing to obtain the model output of the first model in this round of local iteration. In one embodiment, if Figure 3 As shown, the first device inputs the training data into the Net j Processing is performed to obtain the model output N j .

[0136] Step S205, calculating a first sub-gradient value of the predicted loss relative to the parameter according to the model output and the longitudinal federation intermediate result;

[0137] The first device calculates the gradient value of the prediction loss relative to the parameter in the first model based on the model output and the longitudinal federation intermediate result (hereinafter referred to as the first sub-gradient value without distinction). The first device calculates the first sub-gradient value corresponding to each parameter in the first model according to the longitudinal federation intermediate result and the model output using the back propagation method. Specifically, the first sub-gradient value can be calculated according to the following formula:

[0138]

[0139] Where w is the parameter in the first model, N j is the intermediate result sent to the second device during this round of joint parameter update (i.e., the model output of the first model before local iteration), G(N j ) is the second device return prediction loss relative to N j The gradient value, that is, the intermediate result of the vertical federation, N b It is the model output of the first model in this round of local iteration.

[0140] Step S206: Calculate a second sub-gradient value of the proximal optimization loss relative to the parameter, and add the first sub-gradient value and the second sub-gradient value to obtain a gradient value corresponding to the parameter.

[0141] After calculating the proximal optimization loss, the first device calculates the gradient value of the proximal optimization loss relative to the parameter in the first model (hereinafter referred to as the second sub-gradient value without distinction). The first device adds the first sub-gradient value and the second sub-gradient value of the parameter to obtain the gradient value corresponding to the parameter. Specifically, when there are multiple parameters, each parameter has a corresponding first sub-gradient value and a second sub-gradient value, and the first sub-gradient value and the second sub-gradient value of each parameter are added to obtain the gradient values ​​corresponding to each parameter.

[0142] In this embodiment, the first device calculates the gradient value corresponding to the parameter of the first model through the prediction loss and the proximal optimization loss, and then updates the parameter according to the gradient value, thereby updating the parameter in the direction of minimizing the prediction loss and the proximal optimization loss. This not only improves the prediction accuracy of the model, but also constrains the change in the parameter, avoiding distortion due to excessive parameter changes. Therefore, while reducing the communication cost by increasing the number of local iterations, the prediction accuracy of the model can also be guaranteed.

[0143] Further, the step of adding the first sub-gradient value and the second sub-gradient value to obtain the gradient value corresponding to the parameter in step S206 includes:

[0144] Step S2061: multiply the second sub-gradient value by a preset adjustment coefficient and add the resultant value to the first sub-gradient value to obtain a gradient value corresponding to the parameter.

[0145] In one embodiment, an adjustment coefficient may be set in the first device to adjust the constraint strength on the parameter change amount during each round of local iteration. Specifically, the first device may multiply the second sub-gradient value by the adjustment coefficient and then add the first sub-gradient value to obtain the gradient value corresponding to the parameter. The first device may adjust the adjustment coefficient according to the number of rounds of local iterations. For example, in a round of joint parameter update, the adjustment coefficient may be initialized to 0.1 and then increased as the number of rounds of local iterations increases, so as to achieve a greater constraint strength on the parameter change amount when the number of local iteration rounds increases.

[0146] Further, based on the above-mentioned first, second and / or third embodiments, a fourth embodiment of the user risk prediction method of the present invention is proposed. In this embodiment, the method is applied to a first device participating in vertical federated learning, the first device is connected to a second device participating in vertical federated learning, and the first device and the second device can be devices such as smart phones, personal computers and servers. The user risk prediction method includes the following steps:

[0147] Step A10, performing longitudinal federated learning in conjunction with the second device based on the proximal optimization loss to obtain a local risk prediction model, wherein the proximal optimization loss represents a change in parameter values ​​of the local model to be trained in the current local iteration compared to the parameter values ​​in the local iteration of a preset historical round;

[0148] The first device can be a data application participant or a data provider participant. The first device is deployed with a first data set and a first model (hereinafter referred to as the local end training model) constructed based on the data of each user under the first data feature, and the second device is deployed with a second data set and a second model (hereinafter referred to as the other end training model) constructed based on the data of each user under the second data feature. The two data sets have the same user dimension; the first data feature and the second data feature are data features related to predicting user risks, and the first data feature is different from the second data feature; the first model and the second model are two parts of a complete machine learning model, which can be implemented by selecting commonly used machine learning models as needed, such as linear regression models or neural network models, and the prediction results of the model are set to a data form that can characterize the degree of user risk, such as risk value; the first device and the second device jointly use the first data set and the second data set to train the first model and the second model. After the training is completed, the two models can be used to jointly predict the risk of the user. Among them, the risk can be the credit risk of the user before the loan, the default repayment risk of the user's loan, etc. For example, in one embodiment, the first device is a device deployed in a bank, and the first data feature is a feature related to banking business, such as the number of historical loans of a user, the number of historical defaults of a user, etc.; the second device is a device deployed in an e-commerce company, and the second data feature is a feature related to the e-commerce business, such as the number of historical purchases and the amount of purchases of a user, etc. The first device and the second device use their respective data sets to perform longitudinal federated learning to train a model for predicting pre-loan credit risk.

[0149] Specifically, the first device performs longitudinal federated learning with the second device based on the proximal optimization loss to obtain a local risk prediction model. Specifically, the first device can perform local iterations in each round of joint parameter update according to the model parameter update method in the first, second or third embodiment above to update the parameters in the first model, which will not be described in detail here. After performing multiple rounds of joint parameter updates, the first device uses the first model with the final updated parameters as the local risk prediction model.

[0150] Step A20: Use the local risk prediction model to predict the risk value of the user to be predicted.

[0151] After obtaining the local risk prediction model, the first device can use the local risk prediction model to predict the risk value of the user to be predicted. Specifically, the second device also performs local iterations in each round of joint parameter update according to the model parameter update method in the above embodiment to update the parameters in the second model. After multiple rounds of joint parameter update, the second device uses the second model with the final updated parameters as the other-end risk prediction model (wherein, the other end refers to the second device); the first device can use the local risk prediction model and combine it with the other-end risk prediction model in the second device to predict the risk value of the user to be predicted. Among them, the risk value can be a value indicating the degree of risk of the user.

[0152] In one embodiment, the second device can send a risk prediction model on the other end to the first device, and the first device inputs the user data of the user to be predicted under the first data feature into the risk prediction model on the local end to obtain a model output, and then inputs the user data of the user to be predicted under the second data feature into the risk prediction model on the other end to obtain a model output, and obtains the risk value of the user to be predicted based on the two model outputs, for example, the two models are directly added together. In another embodiment, if the first device is a data application participant with label data, the first device inputs the user data of the user to be predicted under the first data feature into the risk prediction model on the local end to obtain a model output; the second device inputs the user data of the user to be predicted under the second data feature into the risk prediction model on the other end to obtain a model output, and sends it to the first device; the first device calculates the risk value of the user to be predicted based on the two model outputs, for example, the risk prediction model on the local end of the first device includes the following: Figure 3 When the two parts NetK and Netc are shown, the first device inputs each model output into the Netc part for processing to obtain the risk value of the user to be predicted. In another embodiment, if the first device is a data provider without label data, and the second device is a data application participant with label data, the first device inputs the user data of the user to be predicted under the first data feature into the risk prediction model on the local side to obtain a model output, and sends the model output to the second device; the second device inputs the user data of the user to be predicted under the second data feature into the risk prediction model on the other side to obtain a model output, and the second device calculates the risk value of the user to be predicted based on the two model outputs, and returns the risk value to the first device.

[0153] In this embodiment, during the process of vertical federated learning between the first device and the second device, a proximal optimization loss is added that can characterize the change in parameter values ​​of the first model in the first device in this round of local iteration compared to the change in parameter values ​​in local iterations of preset historical rounds. A proximal calculation function is used to constrain the change in the parameters of the first model in the local iteration to avoid distortion caused by excessive changes in parameter values ​​during local iterations, thereby reducing the communication cost during user risk prediction while ensuring the accuracy of user risk prediction.

[0154] Furthermore, in one embodiment, the step A10 includes:

[0155] Step A101, receiving the longitudinal federation intermediate result of this round of joint parameter update sent by the second device;

[0156] When the first device performs a round of joint parameter update, the first device receives the longitudinal federation intermediate result of this round of joint parameter update sent by the second device. Specifically, if the first device is a data application participant with labeled data, the second device inputs its training data into the second model for processing to obtain the output of the model in this round of joint parameter update, and sends the output as an intermediate result to the first device, which is the longitudinal federation intermediate result. If the first device is a data provider participant without labeled data, the first device inputs its training data into the first model for processing to obtain the output of the model, and sends the output as an intermediate result to the second device. The second device calculates the gradient value of the prediction loss relative to the output, and sends the gradient value as an intermediate result to the first device, which is the longitudinal federation intermediate result.

[0157] Step A102, performing a preset number of local iterative updates on the parameters in the local end to-be-trained model based on the proximal optimization loss and the longitudinal federation intermediate result;

[0158] The first device performs a preset number of rounds of local iteration updates on the parameters in the model to be trained on the local side based on the proximal optimization loss and the longitudinal federation intermediate result. Specifically, the model parameter update method in the first, second or third embodiment described above can be referred to for performing each round of local iterations on the model to be trained on the local side, which will not be described in detail here. The preset number of rounds can be a number set in advance according to needs.

[0159] Step A103, detecting whether the model to be trained on the local end after the parameter update meets the preset model conditions;

[0160] After performing a preset number of local iterations, the first device detects whether the local model to be trained after the parameter update meets the preset model condition. The preset model condition may be a pre-set condition, such as prediction loss convergence, or the number of rounds of joint parameter update reaches a predetermined number of rounds, or the duration of joint parameter update reaches a predetermined duration.

[0161] Step A104: if satisfied, the local model to be trained after updating the parameters is used as the local risk prediction model;

[0162] If it is detected that the preset model condition is met, the first device may use the local model to be trained after updating the parameters as the local risk prediction model. Correspondingly, the second device may use the other-end model to be trained after updating the parameters as the other-end risk prediction model.

[0163] Step A105: If not satisfied, return to the step of receiving the longitudinal federation intermediate result of this round of joint parameter update sent by the second device.

[0164] If it is detected that the preset model condition is not met, the first device returns to the above step A101, that is, performs the next round of joint parameter update.

[0165] Furthermore, in one embodiment, step A102 includes:

[0166] Step A1021, calculating the proximal optimization loss, and based on the proximal optimization loss, the model output of the local model to be trained in this round of local iteration, and the longitudinal federation intermediate result, calculating the gradient value corresponding to the parameter;

[0167] Step A1022, using the gradient value to update the parameter to complete this round of local iteration;

[0168] Specifically, the first device can calculate the proximal optimization loss and the gradient values ​​corresponding to each parameter according to the specific implementation process of step S10 and step S20 in the above-mentioned first embodiment, and update the parameters according to the gradient values ​​according to the specific implementation process of step S30, which is not described in detail in this embodiment.

[0169] Step A1023, detecting whether the number of local iteration rounds reaches a preset number of rounds;

[0170] Step A1024: if the condition is met, then the step of detecting whether the local model to be trained after the parameter update satisfies the preset model condition is executed;

[0171] Step A1025: If not reached, return to the step of calculating the proximal optimization loss and increment the number of local iterations by 1.

[0172] After completing a round of local iteration, the first device detects whether the current number of local iteration rounds has reached the preset number; if reached, the first device executes step A103; if not, the local iteration round number is increased by 1, and returns to step A1021, that is, the next round of local iteration is performed.

[0173] In addition, the embodiment of the present invention also provides a model parameter updating device, referring to Figure 6 The apparatus is deployed on a first device participating in vertical federated learning, the first device is communicatively connected to a second device participating in vertical federated learning, and the apparatus includes:

[0174] A first calculation module 10 is used to calculate a proximal optimization loss, wherein the proximal optimization loss represents a change in a parameter value of a first model in the first device in the current round of local iteration compared to a parameter value in a local iteration of a preset historical round;

[0175] A second calculation module 20 is used to calculate the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the first model in this round of local iteration, and the longitudinal federation intermediate result received from the second device;

[0176] The updating module 30 is used to update the parameters using the gradient value to complete this round of local iteration.

[0177] Furthermore, the first calculation module 10 includes:

[0178] A first calculation unit, configured to subtract corresponding elements of a parameter vector of a parameter of a first model in the first device in a current round of local iteration from a parameter vector in a preset historical round of local iteration to obtain a difference vector;

[0179] The second calculation unit is used to calculate the sum of squares of each element in the difference vector, and obtain the proximal optimization loss based on the sum of squares.

[0180] Further, when the first device is a participant having label data, the vertical federation intermediate result is the output of the model in the second device, and the second calculation module 20 includes:

[0181] A first processing unit, configured to input the training data of the first device into a first model in the first device for processing, and obtain a model output of the first model in this round of local iteration;

[0182] A third calculation unit, configured to calculate a prediction result based on the model output and the longitudinal federation intermediate result, and calculate a prediction loss based on the prediction result and label data corresponding to the training data;

[0183] The fourth calculation unit is used to add the prediction loss and the proximal optimization loss to obtain a total loss, and calculate the gradient value corresponding to the parameter based on the total loss.

[0184] Further, when the second device is a participant with label data, the vertical federation intermediate result is a gradient value of the prediction loss in the second device relative to the output of the first model sent by the first device during the current round of joint parameter update,

[0185] The second calculation module 20 includes:

[0186] A second processing unit is used to input the training data of the first device into the first model of the first device for processing, so as to obtain a model output of the first model in this round of local iteration;

[0187] a fifth calculation unit, configured to calculate a first sub-gradient value of the predicted loss relative to the parameter according to the model output and the longitudinal federation intermediate result;

[0188] A sixth calculation unit is used to calculate a second sub-gradient value of the proximal optimization loss relative to the parameter, and add the first sub-gradient value and the second sub-gradient value to obtain a gradient value corresponding to the parameter.

[0189] Furthermore, the sixth computing unit is further configured to:

[0190] The second sub-gradient value is multiplied by a preset adjustment coefficient and then added to the first sub-gradient value to obtain a gradient value corresponding to the parameter.

[0191] In addition, an embodiment of the present invention further provides a user risk prediction device, which is deployed on a first device participating in vertical federated learning, and the first device is communicatively connected with a second device participating in vertical federated learning, and the device includes:

[0192] A federated learning module, configured to perform longitudinal federated learning with the second device based on a proximal optimization loss to obtain a local risk prediction model, wherein the proximal optimization loss represents a change in a parameter value of a local model to be trained in the current local iteration compared to a parameter value in a local iteration of a preset historical round;

[0193] The prediction module is used to use the local risk prediction model to predict the risk value of the user to be predicted.

[0194] Furthermore, the federated learning module includes:

[0195] A receiving unit, configured to receive a longitudinal federation intermediate result of this round of joint parameter update sent by the second device;

[0196] A local iteration unit, used for performing a preset number of rounds of local iteration update on the parameters in the local to-be-trained model based on the proximal optimization loss and the longitudinal federation intermediate result;

[0197] A detection unit, used to detect whether the model to be trained on the local end after the parameter update meets the preset model conditions;

[0198] A determination unit, configured to use the local to-be-trained model with updated parameters as the local risk prediction model if the conditions are met;

[0199] The returning unit is used to return to the step of receiving the longitudinal federation intermediate result of the current round of joint parameter update sent by the second device if the condition is not satisfied.

[0200] Furthermore, the local iteration unit includes:

[0201] A calculation subunit, used to calculate the proximal optimization loss, and calculate the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the local to-be-trained model in this round of local iteration, and the longitudinal federation intermediate result;

[0202] An updating subunit, used to update the parameters using the gradient value to complete this round of local iteration;

[0203] A detection subunit, used to detect whether the number of local iteration rounds reaches a preset number of rounds;

[0204] An execution subunit, configured to execute the step of detecting whether the local model to be trained after the parameter update satisfies the preset model condition if the condition is reached;

[0205] The return subunit is used to return to the step of calculating the proximal optimization loss if the value is not reached, and to increase the number of local iteration rounds by 1.

[0206] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a model parameter update program is stored, and when the model parameter update program is executed by a processor, the steps of the model parameter update method described above are implemented. The present invention further proposes a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the model parameter update method described above are implemented. The various embodiments of the model parameter update device, computer-readable storage medium, and computer product of the present invention can all refer to the various embodiments of the model parameter update method of the present invention, and will not be repeated here.

[0207] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a user risk prediction program is stored, and when the user risk prediction program is executed by a processor, the steps of the user risk prediction method described above are implemented. The present invention also proposes a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the user risk prediction method described above are implemented. The various embodiments of the user risk prediction device, computer-readable storage medium, and computer product of the present invention can all refer to the various embodiments of the user risk prediction method of the present invention, and will not be repeated here.

[0208] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0209] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0210] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the embodiments of the present invention.

[0211] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A model parameter updating method, characterized in that: The method is applied to a first device participating in vertical federated learning, the first device being communicatively connected to a second device participating in vertical federated learning, and the method comprises the following steps: Subtracting corresponding elements of a parameter vector of the parameters of the first model in the first device in the current round of local iteration from a parameter vector in the local iteration of a preset historical round to obtain a difference vector; Calculating the sum of squares of elements in the difference vector or the square root of the sum of squares, and obtaining a proximal optimization loss based on the sum of squares or the square root of the sum of squares; The gradient value corresponding to the parameter is calculated based on the proximal optimization loss, the model output of the first model in this round of local iteration, and the longitudinal federation intermediate result received from the second device, and when the first device is a participant with label data, the longitudinal federation intermediate result is the output of the model in the second device, The step of calculating the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the first model in the current round of local iteration, and the longitudinal federation intermediate result received from the second device comprises: Inputting the training data of the first device into the first model in the first device for processing, and obtaining a model output of the first model in this round of local iteration; A prediction result is calculated based on the model output and the longitudinal federation intermediate result, and a prediction loss is calculated based on the prediction result and label data corresponding to the training data; The prediction loss and the proximal optimization loss are added to obtain a total loss, and a gradient value corresponding to the parameter is calculated based on the total loss; The parameters are updated using the gradient values ​​to complete this round of local iteration.

2. The model parameter updating method according to claim 1, characterized in that: When the second device is a participant with label data, the vertical federation intermediate result is the gradient value of the prediction loss in the second device relative to the output of the first model sent by the first device during the current round of joint parameter update. The step of calculating the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the first model in the current round of local iteration, and the longitudinal federation intermediate result received from the second device comprises: Inputting the training data of the first device into the first model of the first device for processing, to obtain a model output of the first model in this round of local iteration; Calculate a first sub-gradient value of the predicted loss relative to the parameter according to the model output and the longitudinal federation intermediate result; A second sub-gradient value of the proximal optimization loss relative to the parameter is calculated, and the first sub-gradient value and the second sub-gradient value are added to obtain a gradient value corresponding to the parameter.

3. The model parameter updating method according to claim 2, characterized in that: The step of adding the first sub-gradient value and the second sub-gradient value to obtain the gradient value corresponding to the parameter comprises: The second sub-gradient value is multiplied by a preset adjustment coefficient and then added to the first sub-gradient value to obtain a gradient value corresponding to the parameter.

4. A user risk prediction method, characterized in that: The method is applied to a first device participating in vertical federated learning, the first device being communicatively connected to a second device participating in vertical federated learning, and the method comprises the following steps: Based on the proximal optimization loss, the local risk prediction model is obtained by jointly performing longitudinal federated learning with the second device. The local risk prediction model is obtained by using the model parameter updating method described in any one of claims 1 to 3, wherein the proximal optimization loss represents the change in the parameter value of the local model to be trained in the current local iteration compared to the parameter value in the local iteration of the preset historical round; The local risk prediction model is used to predict the risk value of the user to be predicted.

5. The user risk prediction method according to claim 4, characterized in that: The step of performing longitudinal federated learning with the second device based on the proximal optimization loss to obtain a local risk prediction model includes: receiving a longitudinal federation intermediate result of this round of joint parameter update sent by the second device; Performing a preset number of local iterative updates on the parameters in the local to-be-trained model based on the proximal optimization loss and the longitudinal federation intermediate result; Check whether the model to be trained on the local end after updating the parameters meets the preset model conditions; If satisfied, the local model to be trained after updating the parameters is used as the local risk prediction model; If not satisfied, return to the step of receiving the longitudinal federation intermediate result of this round of joint parameter update sent by the second device.

6. The user risk prediction method according to claim 5, characterized in that: The step of performing a preset number of rounds of local iterative update on the parameters in the local end to-be-trained model based on the proximal optimization loss and the longitudinal federation intermediate result comprises: Calculate the proximal optimization loss, and calculate the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the local to-be-trained model in this round of local iteration, and the longitudinal federation intermediate result; Using the gradient value to update the parameter to complete this round of local iteration; Check whether the number of local iteration rounds reaches the preset number of rounds; If so, the step of detecting whether the model to be trained on the local end after updating the parameters meets the preset model condition is executed; If not reached, the step of calculating the proximal optimization loss is returned to execute, and the number of local iteration rounds is increased by 1.

7. A model parameter updating device, characterized in that: The apparatus is deployed on a first device participating in vertical federated learning, the first device is communicatively connected with a second device participating in vertical federated learning, and the apparatus includes: A first calculation module is used to subtract corresponding elements of a parameter vector of a parameter of a first model in the first device in the current round of local iteration from a parameter vector in a preset historical round of local iteration to obtain a difference vector; calculate the sum of squares of each element in the difference vector or the square root of the sum of squares, and obtain a proximal optimization loss based on the sum of squares or the square root of the sum of squares; A second calculation module is used to calculate the gradient value corresponding to the parameter based on the proximal optimization loss, the model output of the first model in this round of local iteration, and the longitudinal federation intermediate result received from the second device. When the first device is a participant with label data, the longitudinal federation intermediate result is the output of the model in the second device. The second calculation module is specifically used to input the training data of the first device into the first model in the first device for processing to obtain the model output of the first model in this round of local iteration; calculate the prediction result according to the model output and the longitudinal federation intermediate result, and calculate the prediction loss based on the prediction result and the label data corresponding to the training data; add the prediction loss and the proximal optimization loss to obtain the total loss, and calculate the gradient value corresponding to the parameter based on the total loss; An updating module is used to update the parameters using the gradient value to complete this round of local iteration.

8. A model parameter updating device, characterized in that: The model parameter updating device comprises: a memory, a processor, and a model parameter updating program stored in the memory and executable on the processor. When the model parameter updating program is executed by the processor, the steps of the model parameter updating method according to any one of claims 1 to 3 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a model parameter updating program, and when the model parameter updating program is executed by a processor, the steps of the model parameter updating method according to any one of claims 1 to 3 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the model parameter updating method according to any one of claims 1 to 3 are implemented.