Model training method, system, equipment and medium based on vertical federated learning
By using asynchronous assistants and key server methods in vertical federated learning model training, the real value of participants is calculated and asynchronous training is performed, the problem of low training efficiency in the existing technology is solved, and more efficient model training and a more stable system is achieved.
Patent Information
- Application Number
- CN202111405979.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-24
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2041-11-24
AI Technical Summary
The existing model training method based on vertical federated learning is due to inconsistent data volume, calculation speed and network delay of each participant, resulting in the training time being determined by the slowest participant, forming a barrel effect and affecting the training efficiency.
Using the asynchronous auxiliary and key server method, the predicted values and preset tag values of the remaining participants among multiple participants are calculated, so that they can be trained asynchronously, and the model convergence rate and training efficiency are improved.
When the processing speeds of each party are largely different, the model convergence rate and training efficiency are improved, and new participants are allowed to be added during the training process to improve system stability.
Smart Images

Figure CN114118442B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a model training method, system, device and medium based on vertical federated learning. Background Art
[0002] Federated learning refers to the process in which multiple data owners (i.e., participants) can perform model training and obtain the final model without leaving the local data, and ensure that the gap between the model effect and the aggregate training effect is small enough. Based on the data distribution, federated learning can be divided into horizontal federated learning, vertical federated learning, and federated transfer learning.
[0003] For vertical federated learning, since different features of the same sample belong to different training participants, and the sample labels and features are also separated, the training participants have the same sample space and different feature spaces. In the model synchronization training method based on vertical federated learning proposed in the prior art, each round of iterative update requires the calculation values of all participants to fit the sample label value, and all participants synchronize the model parameters. Since the data volume, calculation speed and network delay of each participant are inconsistent, the training time is determined by the slowest processing participant, thus forming a barrel effect and affecting the training efficiency. Summary of the invention
[0004] In view of the problems in the prior art, the purpose of the present invention is to provide a model training method, system, device and medium based on vertical federated learning, so as to solve the problem of low training efficiency of the existing model training method based on vertical federated learning.
[0005] To achieve the above object, the present invention provides a model training method based on vertical federated learning, which is implemented by multiple participants, an asynchronous assistant and a key server. The method is used to perform multiple rounds of iterative updates on the model parameters of the current participant, wherein one round of iterative updates includes:
[0006] The current participant obtains the model to be trained and the training samples corresponding to itself;
[0007] The current participant calculates a first prediction value corresponding to the training sample based on the model to be trained, and sends the first prediction value to the asynchronous assistant; the asynchronous assistant stores a preset loss function, a preset label value corresponding to the training sample, and second prediction values of the remaining participants among the multiple participants based on the training sample;
[0008] The asynchronous assistant calculates the true value of the current participant based on the training sample based on the preset loss function, the preset label value and the second predicted value;
[0009] The current participant calculates a gradient based on the first predicted value and the true value;
[0010] The current participant updates the parameters of the model to be trained based on the gradient, and the updated model serves as the model to be trained for the next round of iteration or the final model of the current participant.
[0011] Optionally, the current participant calculates a gradient based on the first predicted value and the true value, including:
[0012] The asynchronous assistant calculates a loss value based on the first predicted value and the true value;
[0013] The current participant calculates a gradient based on the loss value.
[0014] Optionally, the current participant calculates a gradient based on the loss value, including:
[0015] The asynchronous assistant calculates the training deviation corresponding to the current participant based on the loss value;
[0016] The current participant calculates a gradient based on the training deviation.
[0017] Optionally, before the step of the current participant acquiring the model to be trained and the training sample corresponding to itself, the method further includes:
[0018] The key server generates a homomorphic encryption key and distributes the homomorphic encryption key to the current participant, other participants, and the asynchronous helper;
[0019] The sending the first prediction value to the asynchronous helper includes:
[0020] The current participant encrypts the first prediction value based on the homomorphic encryption key and sends it to the asynchronous assistant.
[0021] Optionally, the current participant calculates a gradient based on the loss value, including:
[0022] The asynchronous helper sends the training deviation to a key server;
[0023] The key server decrypts the training deviation to obtain a decrypted training deviation;
[0024] The key server sends the decrypted training deviation to the current participant;
[0025] The current participant calculates a gradient based on the decrypted training deviation.
[0026] Optionally, after the step of sending the first prediction value to the asynchronous helper, the method further comprises:
[0027] The asynchronous assistant updates the stored first prediction value associated with the current participant.
[0028] Optionally, the asynchronous assistant calculates the true value of the current participant based on the training sample as follows:
[0029]
[0030] Among them, F(P) represents the true value corresponding to the current participant P, L(y, h(B)) represents the preset loss function, y represents the preset label value corresponding to the training sample, and h(B) represents the second predicted value of the remaining participants B based on the training sample.
[0031] Optionally, the asynchronous assistant calculates a loss value based on the first predicted value and the true value using the formula:
[0032]
[0033] Among them, L P represents the loss value corresponding to the current participant P, and f(P) represents the first predicted value corresponding to the current participant P.
[0034] Optionally, the asynchronous assistant calculates a training deviation corresponding to the current participant based on the loss value, including:
[0035] The asynchronous assistant performs a partial derivative operation on the loss value based on the first prediction value to obtain a training deviation corresponding to the current participant.
[0036] Optionally, the current participant calculates the gradient based on the training deviation as follows:
[0037]
[0038] Where, ΔW P represents the gradient corresponding to the current participant, δ P represents the training deviation corresponding to the current participant, W P Represents the parameters of the model to be trained.
[0039] The present invention also provides a model training system based on vertical federated learning, which is used to implement the above-mentioned model training method based on vertical federated learning, and the system includes:
[0040] Model and sample acquisition module, the current participant obtains the corresponding model to be trained and training samples;
[0041] A first prediction value calculation module, in which the current participant calculates a first prediction value corresponding to the training sample based on the model to be trained, and sends the first prediction value to an asynchronous assistant; the asynchronous assistant stores a preset loss function, a preset label value corresponding to the training sample, and second prediction values of the remaining participants among the multiple participants based on the training sample;
[0042] A true value calculation module, wherein the asynchronous assistant calculates the true value of the current participant based on the training sample based on the preset loss function, the preset label value and the second predicted value;
[0043] A gradient calculation module, in which the current participant calculates a gradient based on the first predicted value and the true value;
[0044] The model updating module is used by the current participant to update the parameters of the model to be trained based on the gradient, and the updated model is used as the model to be trained for the next round of iteration or the final model of the current participant.
[0045] The present invention also provides a model training device based on vertical federated learning, comprising:
[0046] processor;
[0047] a memory in which an executable program of the processor is stored;
[0048] In which, the processor is configured to perform any step of the above-mentioned model training method based on vertical federated learning by executing the executable program.
[0049] The present invention also provides a computer-readable storage medium for storing a program, which, when executed by a processor, implements the steps of any one of the above-mentioned model training methods based on vertical federated learning.
[0050] Compared with the prior art, the present invention has the following advantages and outstanding effects:
[0051] The model training method, system, device and medium based on vertical federated learning provided by the present invention utilize the predicted values and preset label values of the remaining participants among multiple participants to obtain the true value of the current participant among multiple participants, so that the current participant fits its own true value, thereby realizing asynchronous training of the model. It can improve the model convergence rate and training efficiency when the processing speeds of the parties are greatly different; and it allows new participants to be added during the training process, making the training system more stable. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Other features, objectives and advantages of the present invention will become more apparent from a reading of the detailed description of non-limiting embodiments made with reference to the following accompanying drawings.
[0053] Figure 1 A schematic diagram of a model training method based on vertical federated learning disclosed in an embodiment of the present invention;
[0054] Figure 2 A schematic diagram of a model training method based on vertical federated learning disclosed in another embodiment of the present invention;
[0055] Figure 3 A schematic diagram of a model training method based on vertical federated learning disclosed in another embodiment of the present invention;
[0056] Figure 4 A schematic diagram of the structure of a model training system based on vertical federated learning disclosed in one embodiment of the present invention;
[0057] Figure 5 A schematic diagram of the structure of a model training system based on vertical federated learning disclosed in another embodiment of the present invention;
[0058] Figure 6 A schematic diagram of the structure of a model training system based on vertical federated learning disclosed in another embodiment of the present invention;
[0059] Figure 7 A schematic diagram of the structure of a model training device based on vertical federated learning disclosed in one embodiment of the present invention;
[0060] Figure 8 A schematic diagram of the structure of a model training device based on vertical federated learning disclosed in one embodiment of the present invention;
[0061] Fig. 9 A schematic diagram of the structure of a computer-readable storage medium disclosed in one embodiment of the present invention. DETAILED DESCRIPTION
[0062] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present invention will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar structures, and thus their repeated description will be omitted.
[0063] like Figure 1As shown, an embodiment of the present invention discloses a model training method based on vertical federated learning, and the above method is implemented by multiple participants, asynchronous assistants and key servers. Specifically, the multiple participants are different training member devices, such as bank participants and store participants. The training sample can be a community resident group that intersects banks and stores. Since this embodiment is based on vertical federated learning, all participants have different samples and different feature spaces. For example, the features corresponding to store participants are shopping-related, and the features corresponding to bank participants are deposit and loan-related. That is, the sample parameters corresponding to different participants are different.
[0064] The above asynchronous helper is an independent server used to store and calculate data, such as storing the predicted values of each participant, and calculating training deviations or loss values. The key server is mainly used to generate homomorphic encryption keys, distribute keys, and decrypt data.
[0065] The above model training method is used to perform multiple rounds of iterative updates on the model parameters of the current participant among the above multiple participants, wherein one round of iterative updates includes the following steps:
[0066] S110, the current participant obtains the model to be trained and the training samples corresponding to itself. Specifically, the models to be trained corresponding to each participant may be the same, and the training samples corresponding to each participant may be the same, but the sample parameters corresponding to different participants are different. In this step, after the above-mentioned model to be trained is obtained, it is saved locally on the device of the current participant for training. There is no need for an asynchronous assistant to perform training. The above-mentioned model to be trained can be implemented using a model in the prior art, and this application does not impose any restrictions on this.
[0067] In one embodiment of the present application, the acquired training samples can be segmented to form multiple sample segments, and then when executing in subsequent steps, one sample segment is used each time to execute, and the execution is repeated until the training steps of all sample segments are completed. This helps to reduce the amount of calculation in each iterative training process and improve the efficiency of model training.
[0068] S120, the current participant calculates the first prediction value corresponding to the training sample based on the model to be trained, and sends the first prediction value to the asynchronous assistant. The asynchronous assistant stores a preset loss function, a preset label value corresponding to the training sample, and a second prediction value based on the training sample by the remaining participants among the multiple participants. Specifically, the training sample is used as the input of the model to be trained, and the first prediction value corresponding to the training sample parameter of the current participant is calculated.
[0069] In this application, all participants can start training at the same time, but the progress of the training may be different, that is, the iteration rounds of different participants may be different. The remaining participants will also calculate their respective second prediction values in the latest iteration round based on their own sample parameters, and send their respective second prediction values to the asynchronous assistant. In this way, the asynchronous assistant can summarize the second prediction values of each participant. Since the sample parameters corresponding to different participants are different, when fitting the model, the prediction values of all participants' models are generally considered for fitting. Therefore, the above-mentioned preset label value is associated with the training goals of all participants, not just the training goals of a certain participant. For example, it can be obtained by summing the training goals of all participants.
[0070] S130, the asynchronous assistant calculates the true value of the current participant based on the training sample based on the preset loss function, the preset label value and the second predicted value. Specifically, in this embodiment, based on the preset loss function, the preset label value and the second predicted value of the remaining participants among the multiple participants based on the training sample, the negative gradient of the loss function of the remaining participants is calculated, that is, the training target of a certain participant (the current participant in this embodiment), that is, its true value, can be obtained; so that the current participant fits the negative gradient of the loss function of the remaining participants, instead of fitting the preset label value, thereby realizing asynchronous training of the model.
[0071] This step uses the following formula (1) to calculate the true value:
[0072]
[0073] Among them, F(P) represents the true value corresponding to the current participant P, L(y, h(B)) represents the preset loss function, y represents the preset label value corresponding to the training sample, and since the iteration progress of each participant may be inconsistent, in this embodiment, h(B) represents the second predicted value generated by the remaining participant B during the latest round of iterative training based on the above training sample. In other embodiments, there may be multiple remaining participants B, so there may also be multiple h(B).
[0074] Among them, the above-mentioned preset loss function can be implemented using existing technology, and this application does not impose any restrictions on this.
[0075] S140, the current participant calculates the gradient based on the first predicted value and the true value. Specifically, the loss value can be calculated using the difference between the first predicted value and the true value, and then the asynchronous assistant performs a partial derivative operation on the loss value based on the first predicted value to obtain the training deviation corresponding to the current participant, and then the current participant calculates the gradient using the training deviation. The implementation of this step can refer to the existing technology implementation.
[0076] And S150, the current participant updates the parameters of the model to be trained based on the above gradient, and the updated model is used as the model to be trained for the next iteration or the final model of the current participant. Specifically, the gradient is the amount of change in the parameter, so after the gradient is calculated, the parameter can be updated. Exemplarily, when the calculated loss value in the previous step meets the preset convergence condition, the updated model is used as the final model of the current participant. If the preset convergence condition is not met, the updated model continues to be used as the model to be trained for the next iteration.
[0077] like Figure 2 As shown, another embodiment of the present invention discloses a model training method based on vertical federated learning. Based on the above embodiment, the method includes the steps of:
[0078] S110, the current participant obtains the model to be trained and the training samples corresponding to itself.
[0079] S120, the current participant calculates a first prediction value corresponding to the training sample based on the model to be trained, and sends the first prediction value to the asynchronous assistant.
[0080] S230, the asynchronous assistant updates the stored first prediction value associated with the current participant, and calculates the true value of the current participant based on the training sample based on the preset loss function, the preset label value and the second prediction value.
[0081] S240, the asynchronous assistant calculates the loss value based on the first predicted value and the true value. Specifically, this step is calculated using the following formula (2):
[0082]
[0083] Among them, L P represents the loss value corresponding to the current participant P, and f(P) represents the first predicted value corresponding to the current participant P.
[0084] S250, the asynchronous assistant calculates the training deviation corresponding to the current participant based on the loss value. Specifically, this step is calculated using the following formula (3):
[0085]
[0086] Among them, δ P Indicates the training deviation corresponding to the current participant.
[0087] S260, the current participant calculates the gradient based on the above training deviation. Specifically, this step is calculated using the following formula (4):
[0088]
[0089] Where, ΔW P represents the gradient corresponding to the current participant, W P Represents the parameters of the model to be trained.
[0090] And S150, the current participant updates the parameters of the model to be trained based on the above gradient, and the updated model serves as the model to be trained for the next round of iteration or the final model of the current participant.
[0091] like Figure 3 As shown, another embodiment of the present invention discloses a model training method based on vertical federated learning, the method comprising the steps of:
[0092] S310, the key server generates a homomorphic encryption key, and distributes the homomorphic encryption key to the current participant, other participants and the asynchronous assistant.
[0093] S110, the current participant obtains the model to be trained and the training samples corresponding to itself.
[0094] S330, the current participant calculates the first prediction value corresponding to the training sample based on the model to be trained, encrypts the first prediction value based on the homomorphic encryption key, and sends it to the asynchronous assistant.
[0095] S230, the asynchronous assistant updates the stored first prediction value associated with the current participant, and calculates the true value of the current participant based on the training sample based on the preset loss function, the preset label value and the second prediction value.
[0096] S240, the asynchronous assistant calculates a loss value based on the first predicted value and the true value.
[0097] S360, the asynchronous assistant calculates the training deviation corresponding to the current participant based on the loss value, and sends the training deviation to the key server.
[0098] S370, the key server decrypts the training deviation to obtain the decrypted training deviation, and sends the decrypted training deviation to the current participant.
[0099] S380, the current participant calculates a gradient based on the decrypted training deviation.
[0100] And S150, the current participant updates the parameters of the above-mentioned model to be trained based on the gradient, and the updated model is used as the model to be trained for the next round of iteration or the final model of the current participant.
[0101] In this way, data can be encrypted and decrypted using an independent key server, ensuring data security.
[0102] Another embodiment of the present invention discloses a model training method based on vertical federated learning, which includes two participants: a first participant and a second participant. The first characteristic value of the training sample of the first participant is x1, and the first initial weight corresponding to the characteristic is W1. The first participant stores a preset label value z. The second characteristic value of the training sample of the second participant is x2, and the second initial weight corresponding to the characteristic is W2. The model to be trained is a linear regression model. Then, based on formula (5), the training deviation of the first participant can be obtained as:
[0103] δ1=x1W1+x2W2-z (5)
[0104] The method comprises the steps of:
[0105] S410, the first participant calculates the negative gradient of the loss function of the first participant based on the first initial weight, the first eigenvalue and the preset label value z, and sends it to the asynchronous assistant.
[0106] S420, the asynchronous assistant updates the stored negative gradient of the loss function of the first participant, and calculates the training deviation of the first participant based on the negative gradient of the loss function, the first initial weight and the first eigenvalue, and sends the training deviation to the key server.
[0107] S430, the key server decrypts the training deviation and sends it to the first participant. And S440, the first participant updates the parameters of the linear regression model according to the decrypted training deviation.
[0108] In this embodiment, the training deviation of the first participant is the same as the training deviation of the second participant.
[0109] It should be noted that all the above embodiments disclosed in this application can be freely combined, and the technical solutions obtained after the combination are also within the protection scope of this application.
[0110] like Figure 4 As shown, an embodiment of the present invention further discloses a model training system 4 based on vertical federated learning, which includes:
[0111] Model and sample acquisition module 41, the current participant obtains the model to be trained and the training sample corresponding to itself.
[0112] The first prediction value calculation module 42, the current participant calculates the first prediction value corresponding to the training sample based on the model to be trained, and sends the first prediction value to the asynchronous assistant. The asynchronous assistant stores the preset loss function, the preset label value corresponding to the training sample and the second prediction value of the remaining participants based on the training sample.
[0113] The true value calculation module 43, the asynchronous assistant calculates the true value of the current participant based on the training sample based on the preset loss function, the preset label value and the second predicted value.
[0114] The gradient calculation module 44 calculates the gradient based on the first predicted value and the true value by the current participant.
[0115] Model updating module 45, the current participant updates the parameters of the model to be trained based on the gradient, and the updated model serves as the model to be trained for the next round of iteration or the final model of the current participant.
[0116] like Figure 5 As shown, an embodiment of the present invention further discloses a model training system 5 based on vertical federated learning, which includes the model and sample acquisition module 41 disclosed in the above embodiment, the first prediction value calculation module 42, the model update module 45 and the following modules:
[0117] The updating and calculating module 53, the asynchronous assistant updates the stored first prediction value associated with the current participant, and calculates the true value of the current participant based on the training sample based on the preset loss function, the preset label value and the second prediction value.
[0118] The loss calculation module 54, the asynchronous assistant calculates the loss value based on the above-mentioned first predicted value and the above-mentioned true value.
[0119] Deviation calculation module 55, the asynchronous assistant calculates the training deviation corresponding to the current participant based on the loss value.
[0120] The second gradient calculation module 56 calculates the gradient based on the training deviation.
[0121] like Figure 6 As shown, an embodiment of the present invention further discloses a model training system 6 based on vertical federated learning, which includes the model and sample acquisition module 41, update and calculation module 53, loss calculation module 54, model update module 45 disclosed in the above embodiment, and the following modules:
[0122] The key generation and distribution module 61, the key server generates a homomorphic encryption key and distributes the homomorphic encryption key to the current participant, other participants and the asynchronous assistant.
[0123] The first prediction value generation encryption module 63, the above-mentioned current participant calculates the first prediction value corresponding to the above-mentioned training sample based on the above-mentioned model to be trained, and encrypts the above-mentioned first prediction value based on the above-mentioned homomorphic encryption key and sends it to the asynchronous assistant.
[0124] Deviation generation and sending module 66, the asynchronous assistant calculates the training deviation corresponding to the current participant based on the loss value, and sends the training deviation to the key server.
[0125] Deviation decryption module 67, the key server decrypts the above training deviation to obtain the decrypted training deviation, and sends the decrypted training deviation to the current participant.
[0126] The third gradient calculation module 68, the current participant calculates the gradient based on the decrypted training deviation.
[0127] It can be understood that the model training system based on vertical federated learning of the present invention also includes other existing functional modules that support the operation of the model training system based on vertical federated learning. Figures 4 to 6 The model training system based on vertical federated learning shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0128] The model training system based on vertical federated learning in this embodiment is used to implement the above-mentioned model training method based on vertical federated learning. Therefore, the specific implementation steps of the model training system based on vertical federated learning can refer to the above-mentioned description of the model training method based on vertical federated learning, which will not be repeated here.
[0129] like Figure 7 As shown, an embodiment of the present invention further discloses a model training device based on vertical federated learning, which includes the above-mentioned current participant 701, other participants 702, a key server 703 and an asynchronous assistant 704. It should be noted that only two other participants 702 are shown in the figure, but this application does not limit their number.
[0130] An embodiment of the present invention also discloses a model training device based on vertical federated learning, including a processor and a memory, wherein the memory stores an executable program of the processor; the processor is configured to execute the steps in the above-mentioned model training method based on vertical federated learning by executing the executable program. Figure 8 It is a structural diagram of the model training device based on vertical federated learning disclosed in the present invention. Figure 8 The electronic device 600 according to this embodiment of the present invention is described. Figure 8 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0131] like Figure 8 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0132] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps of various exemplary embodiments of the present invention described in the above-mentioned model training method based on vertical federated learning. For example, the processing unit 610 can execute the following steps: Figure 1 Follow the steps shown in .
[0133] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0134] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0135] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0136] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, etc.
[0137] The present invention also discloses a computer-readable storage medium for storing a program, which implements the steps in the above-mentioned model training method based on vertical federated learning when executed. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the above-mentioned model training method based on vertical federated learning in this specification.
[0138] As shown above, when the program of the computer-readable storage medium of this embodiment is executed, it utilizes the predicted values and preset label values of the remaining participants to obtain the true value of the current participant itself, so that the current participant fits its own true value, thereby realizing asynchronous training of the model. When the processing speeds of the parties differ greatly, the model convergence rate and training efficiency can be improved; and new participants are allowed to be added during the training process, making the training system more stable.
[0139] Fig. 9 Schematic diagram of the structure of the computer-readable storage medium of the present invention. Fig. 9 As shown, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0140] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0141] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0142] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0143] The model training method, system, device and medium based on vertical federated learning provided by the embodiments of the present invention utilize the predicted values and preset label values of the remaining participants among multiple participants to obtain the true value of the current participant among multiple participants, so that the current participant fits its own true value, thereby realizing asynchronous training of the model. It can improve the model convergence rate and training efficiency when the processing speeds of the parties differ greatly; and it allows new participants to be added during the training process, making the training system more stable.
[0144] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A model training method based on vertical federated learning, characterized in that: The method is implemented by multiple participants, an asynchronous assistant and a key server, and is used to perform multiple rounds of iterative updates on the model parameters of the current participant among the multiple participants, wherein one round of iterative updates includes: The current participant obtains the corresponding model to be trained and training samples; The current participant calculates a first prediction value corresponding to the training sample based on the model to be trained, and sends the first prediction value to the asynchronous assistant; the asynchronous assistant stores a preset loss function, a preset label value corresponding to the training sample, and second prediction values of the remaining participants among the multiple participants based on the training sample; The asynchronous assistant calculates the true value of the current participant based on the training sample based on the preset loss function, the preset label value and the second predicted value. The formula for calculating the true value of the current participant based on the training sample by the asynchronous assistant is: Wherein, F(P) represents the true value corresponding to the current participant P, L(y,h(B)) represents the preset loss function, y represents the preset label value corresponding to the training sample, and h(B) represents the second predicted value of the remaining participants B based on the training sample; The current participant calculates a gradient based on the first predicted value and the true value; The current participant updates the parameters of the model to be trained based on the gradient, and the updated model serves as the model to be trained for the next round of iteration or the final model of the current participant.
2. The model training method based on vertical federated learning according to claim 1, characterized in that: The current participant calculates a gradient based on the first predicted value and the true value, including: The asynchronous assistant calculates a loss value based on the first predicted value and the true value; The current participant calculates a gradient based on the loss value.
3. The model training method based on vertical federated learning according to claim 2, characterized in that: The current participant calculates a gradient based on the loss value, including: The asynchronous assistant calculates the training deviation corresponding to the current participant based on the loss value; The current participant calculates a gradient based on the training deviation.
4. The model training method based on vertical federated learning according to claim 3, characterized in that: Before the current participant obtains the model to be trained and the training sample corresponding to itself, the method further includes: The key server generates a homomorphic encryption key and distributes the homomorphic encryption key to the current participant, other participants, and the asynchronous helper; The sending the first prediction value to the asynchronous helper includes: The current participant encrypts the first prediction value based on the homomorphic encryption key and sends it to the asynchronous assistant.
5. The model training method based on vertical federated learning according to claim 4, characterized in that: The current participant calculates a gradient based on the loss value, including: The asynchronous helper sends the training deviation to a key server; The key server decrypts the training deviation to obtain a decrypted training deviation; The key server sends the decrypted training deviation to the current participant; The current participant calculates a gradient based on the decrypted training deviation.
6. The model training method based on vertical federated learning according to claim 1, characterized in that: After the step of sending the first prediction value to the asynchronous helper, the method further comprises: The asynchronous assistant updates the stored first prediction value associated with the current participant.
7. The model training method based on vertical federated learning according to claim 1, characterized in that: The asynchronous assistant calculates the loss value based on the first predicted value and the true value as follows: Among them, L P represents the loss value corresponding to the current participant P, and f(P) represents the first predicted value corresponding to the current participant P.
8. The model training method based on vertical federated learning according to claim 7, characterized in that: The asynchronous assistant calculates the training deviation corresponding to the current participant based on the loss value, including: The asynchronous assistant performs a partial derivative operation on the loss value based on the first prediction value to obtain a training deviation corresponding to the current participant.
9. The model training method based on vertical federated learning according to claim 8, characterized in that: The current participant calculates the gradient based on the training deviation as follows: Where, ΔW P represents the gradient corresponding to the current participant, δ P represents the training deviation corresponding to the current participant, W P Represents the parameters of the model to be trained.
10. A model training system based on vertical federated learning, used to implement the model training method based on vertical federated learning as claimed in claim 1, characterized in that: The system comprises: Model and sample acquisition module, the current participant obtains the corresponding model to be trained and training samples; A first prediction value calculation module, in which the current participant calculates a first prediction value corresponding to the training sample based on the model to be trained, and sends the first prediction value to an asynchronous assistant; the asynchronous assistant stores a preset loss function, a preset label value corresponding to the training sample, and second prediction values of the remaining participants among the multiple participants based on the training sample; The real value calculation module, the asynchronous assistant calculates the real value of the current participant based on the training sample based on the preset loss function, the preset label value and the second predicted value. The formula for the asynchronous assistant to calculate the real value of the current participant based on the training sample is: Wherein, F(P) represents the true value corresponding to the current participant P, L(y,h(B)) represents the preset loss function, y represents the preset label value corresponding to the training sample, and h(B) represents the second predicted value of the remaining participants B based on the training sample; A gradient calculation module, in which the current participant calculates a gradient based on the first predicted value and the true value; The model updating module is used by the current participant to update the parameters of the model to be trained based on the gradient, and the updated model is used as the model to be trained for the next round of iteration or the final model of the current participant.
11. A model training device based on vertical federated learning, characterized in that: include: processor; a memory in which an executable program of the processor is stored; Wherein, the processor is configured to execute the steps of the model training method based on vertical federated learning described in any one of claims 1 to 9 by executing the executable program.
12. A computer-readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the steps of the model training method based on vertical federated learning described in any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Network structure searching method and device, equipment, storage medium and program product
CN112686370A
Method, apparatus, and device for optimization of vertically federated learning system, and a readable storage medium
WO2021004551A1