Method, device and readable storage medium for building factor decomposition machine classification model
Through the secret sharing and vertical federal learning modeling in vertical federal learning, the problem of unable to protect data privacy in existing technologies has been solved, and efficient data privacy protection and model performance improvement have been achieved.
Patent Information
- Application Number
- CN202010893157.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-28
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-08-28
AI Technical Summary
In the prior art, the data privacy of each participant cannot be effectively protected when constructing a classification model based on vertical federated learning modeling.
Through secret sharing with the second device, obtain secret sharing initial model parameters and secret sharing training data, and based on these data to perform vertical federal learning modeling with the second device, calculate the secret sharing classification error, and then update the model parameters to build the vertical federal federal. Factor decomposition machine classification model.
It can protect data privacy without the need to encrypt the third -party key encryption in the vertical federal learning modeling, reduce the calculation complexity of data transmission, and improve the calculation efficiency and performance of the model.
Smart Images

Figure CN112000987B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence in financial technology (Fintech), and in particular to a factor decomposition machine classification model construction method, device and readable storage medium. Background Art
[0002] With the continuous development of financial technology, especially Internet technology finance, more and more technologies (such as distributed, blockchain, artificial intelligence, etc.) are applied in the financial field, but the financial industry also puts forward higher requirements on technology, such as higher requirements on the distribution of corresponding to-do items in the financial industry.
[0003] With the continuous development of computer software and artificial intelligence, the application field of federated learning is becoming more and more extensive. At present, vertical federated learning modeling usually adopts an unencrypted two-party federated learning method or a homomorphically encrypted two-party vertical federated learning modeling method to construct a classification model. However, the unencrypted two-party federated learning method has the risk of data leakage and cannot protect the data privacy of the participants in the vertical federated learning modeling. For the homomorphically encrypted two-party vertical federated learning modeling method, a third party is required to generate a key pair and provide encryption and decryption services. The third party must be trustworthy. If the third party is not trustworthy or has low credibility, there is still a risk of data leakage. When building a classification model, the data privacy of the participants in the vertical federated learning modeling is still not protected. Summary of the invention
[0004] The main purpose of this application is to provide a factor decomposition machine classification model construction method, device and readable storage medium, aiming to solve the technical problem in the prior art that the data privacy of each participant cannot be protected when building a classification model based on vertical federated learning modeling.
[0005] To achieve the above-mentioned purpose, the present application provides a factor decomposition machine classification model construction method, which is applied to a factor decomposition machine classification model construction device, and the factor decomposition machine classification model construction method includes:
[0006] Perform secret sharing with the second device to obtain secret sharing initial model parameters and secret sharing training data;
[0007] Based on the secret sharing training data, the secret sharing initial model parameters and preset weight information, perform longitudinal federated learning modeling with the second device to calculate the secret sharing classification error;
[0008] Based on the secret shared classification error, a first target classification model parameter is determined, and the second device is assisted in determining a second target classification model parameter to construct a vertical federated factorization machine classification model.
[0009] The present application also provides a click rate prediction method, which is applied to a click rate prediction device, and the click rate prediction method includes:
[0010] Perform secret sharing with the second device to obtain secret sharing user data to be predicted and secret sharing model parameters;
[0011] Inputting the secret shared user data to be predicted into a preset click rate prediction model, so as to perform click rate prediction on the target user corresponding to the secret shared user data to be predicted based on the secret shared model parameters, and obtain a first secret shared click rate prediction result;
[0012] Based on the first secret shared click rate prediction result, a federal prediction interaction is performed with the second device to calculate a target predicted click rate in conjunction with the second secret shared click rate prediction result determined by the second device.
[0013] The present application also provides a factor decomposition machine classification model construction device, the factor decomposition machine classification model construction device is a virtual device, and the factor decomposition machine classification model construction device is applied to a factor decomposition machine classification model construction device, and the factor decomposition machine classification model construction device includes:
[0014] A secret sharing module, used to perform secret sharing with the second device and obtain secret sharing initial model parameters and secret sharing training data;
[0015] A vertical federation module, configured to perform vertical federated learning modeling with the second device based on the secret sharing training data, the secret sharing initial model parameters and preset weight information, and calculate the secret sharing classification error;
[0016] A determination module is used to determine the first target classification model parameters based on the secret shared classification error, and assist the second device in determining the second target classification model parameters to construct a vertical federated factorization machine classification model.
[0017] The present application also provides a click rate prediction device, which is a virtual device and is applied to a click rate prediction device. The click rate prediction device includes:
[0018] A secret sharing module, used to perform secret sharing with the second device, and obtain secret sharing user data to be predicted and secret sharing model parameters;
[0019] A prediction module, used for inputting the secret sharing user data to be predicted into a preset click rate prediction model, so as to perform click rate prediction on a target user corresponding to the secret sharing user data to be predicted based on the secret sharing model parameters, and obtain a first secret sharing click rate prediction result;
[0020] A joint calculation module is used to perform a federated prediction interaction with the second device based on the first secret shared click rate prediction result, so as to calculate a target predicted click rate by combining the second secret shared click rate prediction result determined by the second device.
[0021] The present application also provides a factor decomposition machine classification model construction device, which is a physical device. The factor decomposition machine classification model construction device includes: a memory, a processor, and a program of the factor decomposition machine classification model construction method stored in the memory and executable on the processor. When the program of the factor decomposition machine classification model construction method is executed by the processor, the steps of the factor decomposition machine classification model construction method as described above can be implemented.
[0022] The present application also provides a click-through rate prediction device, which is a physical device. The click-through rate prediction device includes: a memory, a processor, and a program of the click-through rate prediction method stored in the memory and executable on the processor. When the program of the click-through rate prediction method is executed by the processor, the steps of the click-through rate prediction method as described above can be implemented.
[0023] The present application also provides a readable storage medium, on which is stored a program for implementing a factor decomposition machine classification model construction method. When the program for implementing a factor decomposition machine classification model construction method is executed by a processor, the steps of the factor decomposition machine classification model construction method as described above are implemented.
[0024] The present application also provides a readable storage medium, on which is stored a program for implementing a click-through rate prediction method. When the program of the click-through rate prediction method is executed by a processor, the steps of the click-through rate prediction method as described above are implemented.
[0025] The present application provides a factorization machine classification model construction method, device and readable storage medium. Compared with the technical means used in the prior art to construct a classification model based on an unencrypted two-party federated learning method or a homomorphically encrypted two-party longitudinal federated learning modeling method, the present application obtains secret-sharing initial model parameters and secret-sharing training data by secret sharing with a second device, and then performs longitudinal federated learning modeling with the second device based on the secret-sharing training data, the secret-sharing initial model parameters and preset weight information, calculates the secret-sharing classification error, and then updates the secret-sharing initial model parameters based on the secret-sharing classification error to obtain the secret-sharing classification model update parameters, wherein, when interacting with the second device, the data sent or received are all secret-sharing data, and There is no need for public-private keys generated by a third party to encrypt data. All data transmission processes are carried out between the two parties participating in the vertical federated learning modeling, which protects the privacy of the data. Then, based on the secret shared classification model, the parameters are updated, and the first target classification model parameters are determined by decryption interaction with the second device. The second device is assisted in determining the second target classification model parameters, and the construction of the vertical federated factor decomposition machine classification model is completed. This overcomes the technical defect in the prior art of using an unencrypted two-party federated learning method or a homomorphic encrypted two-party vertical federated learning modeling method to construct a classification model, which makes it impossible to protect the data privacy of each participant in the vertical federated learning modeling. Therefore, the technical problem of being unable to protect the data privacy of each participant when constructing a classification model based on vertical federated learning modeling is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0028] Figure 1 This is a flow chart of the first embodiment of the factor decomposition machine classification model construction method of the present application;
[0029] Figure 2 This is a flow chart of the second embodiment of the factor decomposition machine classification model construction method of the present application;
[0030] Figure 3 This is a flow chart of the third embodiment of the click rate prediction method of the present application;
[0031] Figure 4 A schematic diagram of the device structure of the hardware operating environment involved in the factor decomposition machine classification model construction method of the embodiment of the present application;
[0032] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the click rate prediction method of the embodiment of the present application.
[0033] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0034] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0035] The present application embodiment provides a factor decomposition machine classification model construction method. In the first embodiment of the factor decomposition machine classification model construction method of the present application, refer to Figure 1 The factor decomposition machine classification model construction method is applied to a first device, and the factor decomposition machine classification model construction method includes:
[0036] Step S10, performing secret sharing with the second device to obtain secret sharing initial model parameters and secret sharing training data;
[0037] In this embodiment, it should be noted that the first device and the second device are both participants in vertical federated learning. The first device has first-party training label data with sample labels. The first-party training label data can be represented by a first-party training data matrix and sample labels. For example, assuming that the first-party training label data is (X A , Y), X A is the first party training data matrix, Y is the sample label, and in addition, the second device has second party training data without sample labels, and the second party training data can be represented by the second party training data matrix. For example, assuming that the second party training data matrix is X B .
[0038] In addition, in the present embodiment, the factor decomposition machine classification model is a machine learning model constructed based on vertical federated learning, and the model parameters of the factor decomposition machine classification model are jointly held by the first device and the second device, wherein before performing vertical federated learning, the factor decomposition machine classification model includes first-type initial model parameters and second-type initial model parameters, the first-type initial model parameters include first-party first-type initial model parameters held by the first device and second-party first-type initial model parameters held by the second device, and the second-type initial model parameters include first-party second-type initial model parameters held by the first device and second-party second-type model initial parameters held by the second device. For example, assuming that the first-type initial model parameter is w and the second-type initial model parameter is V, the first-party first-type initial model parameter is w. A , the initial model parameter of the second party first type is w B , the first party second type initial model parameter is V A , the initial parameters of the second type model of the second party are V B .
[0039] In addition, it should be noted that the process of secret sharing of data is to split the data into two parts, and the two parts are held by two parties of secret sharing respectively. For example, assuming that the two parties of secret sharing are A and B, then data X is secret shared, and A holds the first share of data X [[X]] A , B holds the second share of data X [[X]] B , and X=[[X]] A +[[X]] B .
[0040] In addition, it should be noted that the model expression of the factor decomposition machine classification model is as follows:
[0041]
[0042] z(x)=<w,x> +∑ i<j <V i , V j >x i x j
[0043] Wherein, x is the data matrix corresponding to the model input data, wherein the model input data includes the first-party training label data (X A , Y) and the second-party training data X B , where Y is the sample label, X A With d A feature dimensions, X B With d Bfeature dimensions, the first type initial model parameter is w, where w is a d-dimensional vector, the second type initial model parameter is V, where V is a d*d matrix, and before the factor decomposition machine classification model is trained, w=[w A , w B ], that is, w is the first-party first-type initial model parameter w A and the second party's first type initial model parameter w B Composition, among which w A is d A dimensional vector, w B is d B dimensional vector, otherwise, V = [V A , V B ], where V is the second type initial model parameter V A and the second-party second-type model initial parameter V B Composition, among which, V A is d A *d X is a matrix, V B is d B *d X dimensional matrix,<w,x> is the inner product of w and x, V i is the column vector of the i-th column of V, V j is the column vector of the jth column of V, x i is the column vector of the i-th column of x, x j is the column vector of the j-th column of x.
[0044] Perform secret sharing with the second device to obtain secret sharing initial model parameters and secret sharing training data, specifically, obtain the initialization model and the first-party training label data corresponding to the factor decomposition machine classification model, and obtain the first-party first-type initial model parameters and the corresponding first-party second-type initial model parameters corresponding to the initialization model. Similarly, the second device obtains the second-party training data, the second-party first-type initial model parameters and the corresponding second-party second-type model initial parameters corresponding to the initialization model before performing secret sharing, and then the first device and the second device perform secret sharing, wherein when performing secret sharing, the first device provides the first-party training label data, the first-party first-type initial model parameters and the first-party second-type initial model parameters, and the second device provides the second-party training data, the second-party first-type initial model parameters and the second-party second-type model initial parameters, and then the first device obtains the secret sharing initial model parameters. The second device obtains the second-party secret shared initial model parameters and the second-party secret shared training data owned by the second party, wherein the secret shared initial model parameters include the first share of the first-party first-type initial model parameters, the first share of the first-party second-type initial model parameters, the second share of the second-party first-type initial model parameters, the second share of the second-party second-type model initial parameters, the second-party secret shared initial model parameters include the second share of the first-party first-type initial model parameters, the second share of the first-party second-type initial model parameters, the first share of the second-party first-type initial model parameters, the first share of the second-party second-type model initial parameters, the secret shared training data include the first share of the first-party training label data and the second share of the second-party training data, and the second-party secret shared training data include the second share of the first-party training label data and the first share of the second-party training data.
[0045] The secret sharing model parameters include a first sharing parameter and a second sharing parameter, and the secret sharing training data include a first sharing training data and a second sharing training data.
[0046] The step of performing secret sharing with the second device and obtaining secret sharing model parameters and secret sharing training data comprises:
[0047] Step S11, obtaining a first-party model parameter and first-party training label data, and using a first share of the first-party model parameter as the first shared parameter;
[0048] In this embodiment, it should be noted that the first-party model parameters include first-party first-type initial model parameters and first-party second-type initial model parameters, and the second-party secret sharing model parameters include third sharing parameters and fourth sharing parameters.
[0049] Acquire first-party model parameters and first-party training label data, and use the first share of the first-party model parameters as the first shared parameters. Specifically, split the first-party first-type initial model parameters, the first-party second-type initial model parameters and the first-party training label data into two parts, and use the first share of the first-party first-type initial model parameters and the first share of the first-party second-type initial model parameters together as the first shared parameters.
[0050] Step S12, sending the second share of the first party model parameter to the second device, so that the second device can determine a third shared parameter;
[0051] In this embodiment, the second share of the first-party model parameters is sent to the second device so that the second device can determine the third shared parameters. Specifically, the second share of the first-party first-type initial model parameters and the second share of the first-party second-type initial model parameters are both sent to the second device, and then the second device uses the second share of the first-type initial model parameters and the second share of the first-party second-type initial model parameters together as the third shared parameters.
[0052] Step S13, receiving a second shared parameter sent by the second device, wherein the second shared parameter is a second share of a second-party model parameter acquired by the second device, and the first share of the second-party model parameter is a fourth shared parameter of the second device;
[0053] In this embodiment, a second shared parameter sent by the second device is received, wherein the second shared parameter is the second share of the second-party model parameter obtained by the second device, and the first share of the second-party model parameter is the fourth shared parameter of the second device. Specifically, the second device splits the second-party first-type initial model parameter and the second-party second-type model initial parameter into two parts respectively, and then uses the first share of the second-party first-type initial model parameter and the first share of the second-party second-type model initial parameter together as the fourth shared parameter, and sends the second share of the second-party first-type initial model parameter and the second share of the second-party second-type model initial parameter to the first device, and then the first device receives the second share of the second-party first-type initial model parameter and the second share of the second-party second-type model initial parameter, and uses the second share of the second-party first-type initial model parameter and the second share of the second-party second-type model initial parameter together as the second shared parameter.
[0054] Step S14, using the first share of the first-party training label data as the first shared training data, and sending the second share of the first-party training label data to the second device, so that the second device can determine the third shared training data;
[0055] In this embodiment, it should be noted that the second-party secret shared training data includes third shared training data and fourth shared training data.
[0056] The first share of the first-party training label data is used as the first shared training data, and the second share of the first-party training label data is sent to the second device, so that the second device determines the third shared training data. Specifically, the first-party training label data is split into two parts, and then the first share of the first-party training label data is used as the first shared training data, and the second share of the first-party training label data is sent to the second device, and then the second device uses the second share of the first-party training label data as the third shared training data.
[0057] Step S15: receiving second shared training data sent by the second device, wherein the second shared training data is a second share of second-party training data acquired by the second device, and the first share of the second-party training data is fourth shared training data of the second device.
[0058] In this embodiment, second shared training data sent by a second device is received, wherein the second shared training data is the second share of the second-party training data acquired by the second device, and the first share of the second-party training data is the fourth shared training data of the second device. Specifically, the second device splits the second-party training data into two parts, and uses the first share of the second-party training data as the fourth shared training data, sends the second share of the second-party training data to the first device, and the first device uses the first share of the second-party training data as the second shared training data.
[0059] Step S20, based on the secret sharing training data, the secret sharing initial model parameters and preset weight information, perform longitudinal federated learning modeling with the second device to calculate the secret sharing classification error;
[0060] In this embodiment, it should be noted that the secret shared training data includes first shared training data and second shared training data, wherein the first shared training data is the first share of the first party's training label data, and the second shared training data is the second share of the second party's training data, and the secret shared initial model parameters include first shared parameters and second shared parameters, wherein the first shared parameters include the first share of the first party's first type initial model parameters and then the first share of the first party's second type initial model parameters, and the second shared parameters include the second share of the second party's first type initial model parameters and the second share of the second party's second type model initial parameters.
[0061] Additionally, the second device provides second-party secret shared training data and second-party secret shared initial model parameters when performing vertical federated learning modeling, wherein the second-party secret shared training data includes third shared parameter training data and fourth shared training data, wherein the third shared training data is the second share of the first-party training label data, and the fourth shared training data is the first share of the second-party training data, and the secret shared initial model parameters include third shared parameters and fourth shared parameters, wherein the third shared parameters include the second share of the first-party first-type initial model parameters and then the second share of the first-party second-type initial model parameters, and the fourth shared parameters include the first share of the second-party first-type initial model parameters and the first share of the second-type initial model parameters of the second party.
[0062] Based on the secret sharing training data, the secret sharing initial model parameters and the preset weight information, vertical federated learning modeling is performed with the second device to calculate the secret sharing classification error. Specifically, based on the first sharing parameter, the second sharing parameter, the first shared training data and the second shared training data, a federal interaction is performed with the second device, wherein the second device provides a third sharing parameter, a fourth sharing parameter, the third shared training data and the fourth shared training data during the federal interaction to calculate the secret sharing intermediate parameters, and then based on the secret sharing intermediate parameters and the preset weight information, the secret sharing classification error is calculated by using the preset secret sharing classification error calculation formula.
[0063] Wherein, the secret sharing training data includes secret sharing label data,
[0064] The step of performing longitudinal federated learning modeling with the second device based on the secret sharing training data, the secret sharing initial model parameters and the preset weight information to calculate the secret sharing classification error comprises:
[0065] Step S21, based on a preset secret sharing mechanism, by performing federation interaction with the second device, calculating the classification parameter item corresponding to the secret sharing initial model parameter and the secret sharing training data;
[0066] In this embodiment, it should be noted that the classification parameter item is an expression for calculating the secret sharing classification error, the preset secret sharing mechanism includes secret sharing addition and secret sharing multiplication, the secret sharing initial model parameters include first type sharing parameters and second type sharing parameters, wherein the first type sharing parameters include the first share of the first type initial model parameters of the first party and the second share of the first type initial model parameters of the second party, the second type sharing parameters include the first share of the second type initial model parameters of the first party and the second share of the second type initial model parameters of the second party, and the second device has the second party first type sharing parameters and the second party second type sharing parameters, wherein the second party first type sharing parameters include the second share of the first type initial model parameters of the first party and the first share of the first type initial model parameters of the second party, the second party second type sharing parameters include the second share of the first type initial model parameters of the first party and the first share of the second type initial model parameters of the second party, the secret sharing label data is a sample label of secret sharing, and the classification parameter item includes the inner product of the secret sharing cross-feature terms and the secret sharing intermediate parameters.
[0067] Based on the preset secret sharing mechanism, by performing a federated interaction with the second device, the classification parameter items corresponding to the secret sharing initial model parameters and the secret sharing training data are calculated. Specifically, based on secret sharing multiplication, by performing a federated interaction with the second device, the cross inner product between each parameter element in the second type of shared parameters and each training data element of the secret sharing training data is calculated, wherein there is a cross inner product between a parameter element and a training data element, and then each cross inner product is accumulated to obtain a secret sharing cross feature item inner product. In addition, when performing a federated interaction, based on secret sharing multiplication, the second device calculates the second party second The second-party cross inner product between each second-party parameter element in the type shared parameter and each second training data element in the second-party secret shared training data is used to obtain the second-party secret shared cross-characteristic item inner product. Further, based on the first secret shared multiplication triplet corresponding to the secret shared multiplication, through federal interaction with the second device, a first intermediate parameter item is calculated based on the first type shared parameter and the secret shared training data, and a second intermediate parameter item is calculated based on the second type shared parameter, the secret shared cross-characteristic item inner product and the secret shared training data, and then the sum of the first intermediate parameter item and the second intermediate parameter item is calculated to obtain the secret shared intermediate parameter.
[0068] The secret sharing initial model parameters include first type sharing parameters and second type sharing parameters, the classification parameter items include secret sharing intermediate parameters, the preset secret sharing mechanism includes secret sharing multiplication,
[0069] The step of calculating the classification parameter items corresponding to the secret sharing initial model parameters and the secret sharing training data based on the preset secret sharing mechanism by performing federated interaction with the second device comprises:
[0070] Step S211, based on the secret sharing multiplication, by performing federation interaction with the second device, calculating the cross inner product between each element in the second type of sharing parameter and each element in the secret sharing training data, to obtain the cross inner product of each element;
[0071] In this embodiment, it should be noted that the element cross inner product includes a first element cross inner product and a second element cross inner product, the secret shared training data includes first secret shared training data and second secret shared training data, wherein the first secret shared training data is the second share of the second party's training data, and the second secret shared training data is the first share of the first party's training label data, and the second type of shared parameters includes first shared second type initial model parameters and second shared second type initial model parameters, wherein the first shared second type initial model parameters are the second share of the second party's second type initial model parameters, and the second shared second type initial model parameters are the first share of the first party's second type initial model parameters, and the first shared second type initial model parameters may be parameters in matrix form, each column of the first shared second type initial model parameters is a first parameter element, the first shared training data is training data in matrix form, and each column of the first shared training data is a first training data element, and in addition, the second shared second type initial model parameters may be parameters in matrix form, each column of the second shared second type initial model parameters is a second parameter element, the second shared training data is training data in matrix form, and each column of the second shared training data is a second training data element.
[0072] Based on the secret sharing multiplication, by performing a federal interaction with the second device, the cross inner product between each element in the second type shared parameter and each element in the secret sharing training data is calculated to obtain the cross inner product of each element. Specifically, a second secret sharing multiplication triplet corresponding to the secret sharing multiplication is obtained, and then based on the second secret sharing multiplication triplet, a federal interaction is performed with the second device through secret sharing multiplication to calculate the inner product between each first parameter element and each first training data element to obtain each first element cross inner product, wherein the second device calculates the second party first element cross inner product when performing a federal interaction with the first device. Similarly, a third secret sharing multiplication triplet corresponding to the secret sharing multiplication is obtained, and then based on the third secret sharing multiplication triplet, a federal interaction is performed with the second device through secret sharing multiplication to calculate the inner product between each second parameter element and each second training data element to obtain each second element cross inner product, wherein similarly, the second device calculates the second party second element cross inner product.
[0073] Among them, in an implementable solution, the method for calculating the inner product is as follows:
[0074] Assume that the first device has the secret shared multiplication triplet ([[a]] A ,[[b]] A , [[c]] A ), the second device possesses the secret shared multiplication triplet ([[a]] B ,[[b]] B , [[c]] B ), where [[a]] A +[[a]] B =a,[[b]] A +[[b]] B =b,[[c]] A +[[c]] B =c, c=a*b, and the first parameter element is the secret shared [[x]] A , the first training data element is [[y]] A , the parameter element corresponding to the first parameter element in the second device is [[x]] B , the training data element corresponding to the first training data element is [[y]] B , where [[x]] A +[[x]] B =x,[[y]] A +[[y]] B =y, then the cross inner product of the first element calculated by the first device is the secret shared [[x*y]] A, the cross inner product of the first element of the second side calculated by the second device is [[x*y]] B , and [[x*y]] A +[[x*y]] B =x*y, and then, specifically, the calculation process is as follows:
[0075] First, the first device calculates [[e]] A =[[x]] A -[[a]] A and [[f]] A =[[y]] A -[[b]] A , the second device calculates [[e]] B =[[x]] B -[[a]] B and [[f]] B =[[y]] B -[[b]] B , and then the first device will [[e]] A and [[f]] A Send to the second device, the second device will [[e]] B and [[f]] B Send to the second device, so that the first device and the second device both obtain e=xa and f=yb, and then the first device calculates [[x*y]] A =f*[[a]] A +e*[[b]] A +[[c]] A , the second device calculates [[x*y]] B =e*f+f*[[a]] B +e*[[b]] B +[[c]] B , and then [[x*y]] A +[[x*y]] B =e*f+f*a+e*b+c, and then substitute e=xa and f=yb into the calculation expression to obtain [[x*y]] A +[[x*y]] B =x*y, that is, the cross inner product of the first elements and the cross inner product of the second first elements are calculated.
[0076] Step S212, accumulating the cross inner products of each element to obtain the secret shared cross feature item inner product;
[0077] In this embodiment, the cross inner products of the elements are accumulated to obtain the secret shared cross feature item inner product. Specifically, the cross inner products of the first elements are accumulated to obtain the first cross feature item inner product, and the cross inner products of the second elements are accumulated to obtain the second cross feature item inner product, wherein the calculation expression of the first cross feature item inner product is as follows:
[0078]
[0079] in, is a first parameter element of the secret share owned by the first device, that is, a column vector in the second share of the second type of initial model parameters of the second party, The first training data element of the secret share owned by the first device is the column vector in the second share of the second party's training data. In addition, the calculation formula of the inner product of the second feature cross feature term is as follows:
[0080]
[0081] in, is the second parameter element of the secret share owned by the first device, that is, the column vector in the first share of the second type initial model parameter of the first party, The second training data element of the secret share owned by the first device is the column vector in the first share of the first-party training label data.
[0082] Additionally, the second device calculates the inner product of the second party's first cross-feature term using the following formula:
[0083]
[0084] in, is the second party first parameter element of the secret share owned by the second device, that is, the column vector in the first share of the second party second type initial model parameter, The second training data element of the secret share owned by the second device is the column vector in the second share of the first training label data. In addition, the second device calculates the inner product of the second cross-feature term of the second party as follows:
[0085]
[0086] in, is a second-party second parameter element of the secret share owned by the second device, that is, a column vector in the second share of the first-party second-type initial model parameter, The second party second training data element of the secret share possessed by the second device is also a column vector in the second share of the first party training label data.
[0087] Step S213, based on the secret sharing multiplication and the secret sharing addition, by performing federated interaction with the second device, calculating a first intermediate parameter item corresponding to the first type of shared parameter and the secret sharing training data, and calculating a second intermediate parameter item corresponding to the secret sharing cross-feature item inner product, the secret sharing training data, and the second type of shared parameter;
[0088] In this embodiment, it should be noted that the first intermediate parameter item includes a first shared intermediate parameter item and a second shared intermediate parameter item, the first type of shared parameters include a first shared first type initial model parameter and a second shared first type initial model parameter, wherein the first shared first type initial model parameter is the second share of the second party's first type initial model parameter, and the second shared first type initial model parameter is the first share of the first party's first type initial model parameter, the secret shared training data includes first shared training data and second shared training data, wherein the first shared training data is the second share of the second party's training data, and the second shared training data is the first share of the first party's training data, and the second intermediate parameter item includes a third shared intermediate parameter item and a fourth shared intermediate parameter item.
[0089] Based on the secret sharing multiplication and the secret sharing addition, by performing federal interaction with the second device, a first intermediate parameter item corresponding to the first type of shared parameter and the secret sharing training data is calculated, and the inner product of the secret sharing cross-feature item, the second intermediate parameter item corresponding to the secret sharing training data and the second type of shared parameter is calculated. Specifically, based on the secret sharing multiplication triple, by performing federal interaction with the second device, the inner products of the first shared first type initial model parameter and each column vector of the first shared training data are calculated respectively to obtain each first intermediate parameter inner product, and each first intermediate parameter inner product is accumulated and added to obtain the first shared intermediate parameter item, and the inner products of the second shared first type initial model parameter and each column vector of the second shared training data are calculated respectively to obtain each second intermediate parameter inner product, and each second intermediate parameter inner product is accumulated and added to obtain the second shared intermediate parameter item, wherein the calculation expression of the first shared intermediate parameter item is as follows:
[0090]
[0091] Wherein, M1 is the first shared intermediate parameter item, d B Represents X B The feature dimension is d B ,[[w B ]] AThe first shared first type initial model parameter of the secret shared by the first device, that is, the second share of the first type initial model parameter of the second party, [[X B ]] A is an element in the first shared training data of the secret share of the first device, that is, a column vector of the second share of the second party's training data, X B is the first shared training data. Additionally, the calculation expression of the second shared intermediate parameter item is as follows:
[0092]
[0093] Wherein, M2 is the second shared intermediate parameter item, d A Represents X A The feature dimension is d A ,[[w A ]] A The second shared first type initial model parameter of the secret shared by the first device, that is, the first share of the first type initial model parameter of the first party, [[X A ]] A is an element in the second shared training data of the secret share of the first device, that is, a column vector of the first share of the first party training label data, X A For the second shared training data, further, obtain the first transposed matrix corresponding to the first shared second type initial model parameter and the second transposed matrix corresponding to the first shared training data, and then based on the secret shared multiplication, through federal interaction with the second device, calculate the inner product of the first shared second type initial model parameter, the first transposed matrix, the first shared training data and the second transposed matrix, obtain the first inner product term, and calculate the third shared intermediate parameter term based on the first cross-characteristic item inner product and the first inner product term. Similarly, obtain the third transposed matrix corresponding to the second party's second type shared parameter and the fourth transposed matrix corresponding to the second shared training data, and then based on the secret shared multiplication, through federal interaction with the second device, calculate the inner product of the second party's second type shared parameter, the third transposed matrix, the second shared training data and the fourth transposed matrix, obtain the second inner product term, and calculate the fourth shared intermediate parameter term based on the second cross-characteristic item inner product and the second inner product term, wherein the expression of the third shared intermediate parameter term is as follows:
[0094]
[0095] in,[[ ]] A represents the data of the portion of the share owned by the first device after secret sharing, V B The second type of shared parameter for the second party, X Bis the second-party training data, V B Column vector of V B With d x column vector, For X B A column vector of B With d B column vector, and in addition, the expression of the fourth shared intermediate parameter term is as follows:
[0096]
[0097] in,[[]] A represents the partial share of data owned by the first device after secret sharing, V A is the first-party second-type initial model parameter, X A For first-party training label data, V A Column vector of V A With d x column vector, For X A A column vector of X A With d A A column vector.
[0098] In addition, if necessary, the second device will calculate the second party's first shared intermediate parameter item based on the first share of the second party's first type initial model parameters and the first share of the second party's training data, wherein the second party's first shared intermediate parameter item is calculated in the same manner as the first shared intermediate parameter item, and the second device will calculate the second party's second shared intermediate parameter item based on the first party's second share of the first type initial model parameters and the second share of the first party's training label data, wherein the second party's second shared intermediate parameter item is calculated in the same manner as the second shared intermediate parameter item.
[0099] In addition, it should be noted that the second device will calculate the second party third shared intermediate parameter item and the second party fourth shared intermediate parameter item based on the partial share of data owned by the second device after secret sharing, and the calculation method is consistent with the calculation method in the first device. The second party third shared intermediate parameter item and the second party fourth shared intermediate parameter item are as follows:
[0100]
[0101]
[0102] in,[[ ]] B Data representing the portion of the share owned by the second device after secret sharing.
[0103] Step S214: determining the secret sharing intermediate parameter based on the first intermediate parameter item and the second intermediate parameter item.
[0104] In this embodiment, the secret sharing intermediate parameters include a first secret sharing intermediate parameter and a second secret sharing intermediate parameter.
[0105] Based on the first intermediate parameter item and the second intermediate parameter item, the secret sharing intermediate parameter is determined. Specifically, the sum of the first shared intermediate parameter item and the third shared intermediate parameter item is calculated to obtain the first secret sharing intermediate parameter, and the sum of the second shared intermediate parameter item and the fourth shared intermediate parameter item is calculated to obtain the second secret sharing intermediate parameter, wherein the calculation expression of the first secret sharing intermediate parameter is as follows:
[0106]
[0107] Among them, [[f(X B )]] is the first secret sharing intermediate parameter. In addition, the calculation expression of the second secret sharing intermediate parameter is as follows:
[0108]
[0109] Among them, [[f(X A )]] is the first secret shared intermediate parameter. In addition, the second device will calculate the sum of the second party's first shared intermediate parameter item and the second party's third shared intermediate parameter item to obtain the second party's first secret shared intermediate parameter, and calculate the sum of the second party's second shared intermediate parameter item and the second party's fourth shared intermediate parameter item to obtain the second party's second secret shared intermediate parameter.
[0110] Step S22: calculating the secret sharing classification error based on the classification parameter item, the preset weight information and the secret sharing label data.
[0111] In this embodiment, it should be noted that the secret shared label data is a partial share of the sample label owned by the first device after secret sharing, the second device owns the second party secret shared label data, the classification parameter items include the first secret shared intermediate parameter and the second secret shared intermediate parameter, the preset weight information includes the first weight and the second weight, and the classification parameter items include the inner product of the secret shared cross-feature items and the secret shared intermediate parameter.
[0112] Based on the classification parameter items, the preset weight information and the secret sharing label data, the secret sharing classification error is calculated. Specifically, the first secret sharing intermediate parameter, the second secret sharing intermediate parameter, the first weight, the second weight and the secret sharing label data are substituted into the preset secret sharing classification error calculation formula to calculate the secret sharing classification error.
[0113] The preset weight information includes a first weight and a second weight.
[0114] The step of calculating the secret sharing classification error based on the classification parameter item, the preset weight information and the secret sharing label data comprises:
[0115] Step S221, calculating a first weighted item based on the classification parameter item and the first weight, and calculating a second weighted item based on the secret shared label data and the second weight;
[0116] In this embodiment, a first weighted item is calculated based on the classification parameter item and the first weight, and a second weighted item is calculated based on the secret shared label data and the second weight. Specifically, the product of the classification parameter item and the first weight is calculated to obtain the first weighted item, and the product of the secret shared label data and the second weight is calculated to obtain the second weighted item.
[0117] Step S222: Calculate the secret sharing classification error based on the first weighted term and the second weighted term.
[0118] In this embodiment, the secret sharing classification error is calculated based on the first weighted item and the second weighted item. Specifically, the difference between the first weighted item and the second weighted item is calculated to obtain the secret sharing classification error, wherein the preset secret sharing classification error calculation formula is as follows:
[0119]
[0120] Among them, Y is the sample label, μ is the first weight, preferably, the value of μ is 1 / 4, ν is the second weight, preferably, the value of ν is 1 / 2, and similarly, the second device substitutes the second party's first secret sharing intermediate parameter, the second party's second secret sharing intermediate parameter and the second party's secret sharing label data into the preset classification error calculation formula to calculate the second party's secret sharing classification error.
[0121] Step S30, based on the secret shared classification error, determine the first target classification model parameters, and assist the second device in determining the second target classification model parameters to construct a vertical federated factorization machine classification model.
[0122] In this embodiment, based on the secret sharing classification error, the first target classification model parameters are determined, and the second device is assisted in determining the second target classification model parameters to construct a vertical federated factor decomposition machine classification model. Specifically, the calculation of the secret sharing classification error is repeated to iteratively update the secret sharing initial model parameters until the preset model training end condition is reached to obtain the first secret sharing target parameters. Similarly, the second device will repeat the calculation of the second party secret sharing classification error to iteratively update the second party secret sharing initial model parameters until the preset model training end condition is reached to obtain the second secret sharing target parameters, and then receive the second secret sharing target parameters sent by the second device. The second shared first-party target parameter in the first secret shared target parameter is obtained, and the first shared first-party target parameter in the first secret shared target parameter is obtained, the sum of the first shared first-party target parameter and the second shared first-party target parameter is calculated, and the first target classification model parameter is obtained, and the second shared second-party target parameter in the first secret shared target parameter is sent to the second device, so that the second device can calculate the second shared second-party target parameter and the sum of the first shared second-party target parameter in the second secret shared target parameter to obtain the second target classification model parameter, that is, the first type of initial model parameters and the second type of initial model parameters after the model training is completed are determined, and then the classification model of the vertical federated factor decomposition machine can be determined.
[0123] In addition, it should be noted that the vertical federated factor decomposition machine classification model is a classification model. Compared with the existing vertical federated learning method, the present application does not require a homomorphic encryption and decryption process when constructing a vertical federated factor decomposition machine classification model based on vertical federated learning, thereby reducing the amount of computation during vertical federated learning modeling, thereby improving the computational efficiency when constructing the vertical federated factor decomposition machine classification model. Moreover, since the vertical federated factor decomposition machine classification model is constructed based on vertical federated learning modeling, the feature richness of the training samples when constructing the vertical federated factor decomposition machine classification model is higher, and thus the model performance of the vertical federated factor decomposition machine classification model will be better, and thus the classification effect of the vertical federated factor decomposition machine classification model will be better, for example, the classification accuracy will be higher.
[0124] The present embodiment provides a method for constructing a factorization machine classification model. Compared with the technical means used in the prior art to construct a classification model based on an unencrypted two-party federated learning method or a homomorphically encrypted two-party longitudinal federated learning modeling method, the present embodiment obtains secret-sharing initial model parameters and secret-sharing training data by performing secret sharing with a second device, and then performs longitudinal federated learning modeling with the second device based on the secret-sharing training data, the secret-sharing initial model parameters and preset weight information, calculates the secret-sharing classification error, and then updates the secret-sharing initial model parameters based on the secret-sharing classification error to obtain the secret-sharing classification model update parameters, wherein, when interacting with the second device, the data sent or received are all secret-sharing data, and no third party is required. The public-private key generated by the two parties is used to encrypt the data, and all data transmission processes are carried out between the two parties participating in the vertical federated learning modeling, which protects the privacy of the data. Then, the parameters of the classification model are updated based on the secret sharing, and the first target classification model parameters can be determined by decryption interaction with the second device, and the second device is assisted in determining the second target classification model parameters, so as to complete the construction of the vertical federated factor decomposition machine classification model, which overcomes the technical defect of the prior art that the classification model is constructed based on the unencrypted two-party federated learning method or the homomorphic encrypted two-party vertical federated learning modeling method, which makes it impossible to protect the data privacy of the participants in the vertical federated learning modeling. Therefore, the technical problem that the data privacy of each participant cannot be protected when the classification model is constructed based on the vertical federated learning modeling is solved.
[0125] Further, refer to Figure 2 Based on the first embodiment of the present application, in another embodiment of the present application, the step of determining the first target classification model parameters based on the secret shared classification error and assisting the second device in determining the second target classification model parameters includes:
[0126] Step S31, based on the secret sharing classification error, updating the secret sharing initial model parameters to obtain the secret sharing classification model update parameters;
[0127] In this embodiment, based on the secret sharing classification error, the secret sharing initial model parameters are updated to obtain the secret sharing classification model update parameters. Specifically, based on the secret sharing classification error, the model gradient information corresponding to the secret sharing initial model parameters is calculated, and then based on the model gradient information, the secret sharing initial model parameters are updated to obtain the secret sharing classification model update parameters.
[0128] The secret sharing model parameters include a first secret sharing initial model parameter and a second secret sharing initial model parameter, and the secret sharing classification model update parameters include a first sharing classification model parameter and a second sharing classification model parameter.
[0129] The step of updating the secret sharing initial model parameters based on the secret sharing classification error to obtain the secret sharing classification model update parameters comprises:
[0130] Step S311, calculating first gradient information of the secret sharing classification error with respect to the first secret sharing initial model parameters, and calculating second gradient information of the secret sharing classification error with respect to the second secret sharing initial model parameters;
[0131] In this embodiment, it should be noted that the first secret shared initial model parameters include the first share of the first party's first type initial model parameters and the first share of the first party's second type initial model parameters, the first gradient information includes the first type gradient and the second type gradient, wherein the first type gradient is the gradient of the secret share corresponding to the first share of the first party's first type initial model parameters, the second type gradient is the gradient set of the secret share of each column vector in the first share of the first party's second type initial model parameters, the second secret shared initial model parameters include the second share of the first type initial model parameters of the second party and the second share of the second type initial model parameters of the second party, the second gradient information includes the third type gradient and the fourth type gradient, wherein the third type gradient is the gradient of the secret share corresponding to the second share of the second party's first type initial model parameters, and the fourth type gradient is the gradient set of the secret share of each column vector in the second share of the second party's second type initial model parameters.
[0132] Calculate the first gradient information of the secret shared classification error with respect to the first secret shared initial model parameter, and calculate the second gradient information of the secret shared classification error with respect to the second secret shared initial model parameter. Specifically, calculate the partial derivative of the secret shared classification error with respect to the first share of the first type of initial model parameter of the first party to obtain the first type of gradient, and calculate the partial derivative of the secret shared classification error with respect to each column vector in the first share of the second type of initial model parameter of the first party to obtain the second type of gradient, wherein the calculation expression of the first type of gradient is as follows:
[0133]
[0134] Where T1 is the first type of gradient, α is a hyperparameter whose size can be set by yourself and is used to control the value range of the gradient, and w Ais the first-party first-type initial model parameter, [[w A ]] A is the first share of the first-type initial model parameter of the first party. In addition, the calculation expression of the second-type gradient is as follows:
[0135]
[0136] Where T2 is the second type of gradient, α is a hyperparameter whose size can be set by yourself and is used to control the value range of the gradient, V A is the first party second type initial model parameter, [[V A ]] A a first share of the second type initial model parameters for the first party, is a column vector of the first share of the second type initial model parameters of the first party, further, the partial derivative of the secret shared classification error with respect to the second share of the first type initial model parameters of the second party is calculated to obtain the third type gradient, and the partial derivative of the secret shared classification error with respect to each column vector in the second share of the second type initial model parameters of the second party is calculated to obtain the fourth type gradient, wherein the calculation expression of the third type gradient is as follows:
[0137]
[0138] Wherein, T3 is the third type of gradient, α is a hyperparameter whose size can be set by oneself and is used to control the value range of the gradient, and w B is the first type initial model parameter of the second party, [[w B ]] A is the second share of the first type initial model parameter of the second party. Additionally, the calculation expression of the fourth type gradient is as follows:
[0139]
[0140] Wherein, T4 is the fourth type of gradient, α is a hyperparameter whose size can be set by oneself and is used to control the value range of the gradient, V B For the second party second type shared parameter, [[V B ]] A a second share of the second type of initial model parameters for the second party, A column vector of second shares of the second type initial model parameters of the second party.
[0141] In addition, it should be noted that the second device can also calculate the partial derivative of the second party's secret shared classification error with respect to the first share of the second party's first type initial model parameters to obtain the fifth type of gradient, and calculate the partial derivative of the second party's secret shared classification error with respect to each column vector in the first share of the second party's second type initial model parameters to obtain the sixth type of gradient, and then calculate the partial derivative of the second party's secret shared classification error with respect to the second share of the first party's first type initial model parameters to obtain the seventh type of gradient, and calculate the partial derivative of the second party's secret shared classification error with respect to each column vector in the second share of the first party's second type initial model parameters to obtain the eighth type of gradient, wherein the method of calculating the gradient in the second device is consistent with the method of calculating the gradient in the first device.
[0142] Step S312: based on the first gradient information and the preset first learning parameters, updating the first secret sharing initial model parameters until a preset federated learning end condition is met, thereby obtaining the first shared classification model parameters;
[0143] In this embodiment, it should be noted that the preset federated learning termination conditions include convergence of the loss function, reaching a preset iteration number threshold, etc., and the preset first learning parameters include a first learning rate and a second learning rate.
[0144] Based on the first gradient information and the preset first learning parameter, the first secret shared initial model parameter is updated until the preset federated learning end condition is met, and the first shared classification model parameter is obtained. Specifically, the product of the first type of gradient and the first learning rate is calculated to obtain a first gradient descent value, and then the difference between the first share of the first type of initial model parameter of the first party and the first gradient descent value is calculated to obtain a first update parameter, and the product of the second type of gradient and the second learning rate is calculated to obtain a second gradient descent value, and then the difference between the first share of the second type of initial model parameter of the first party and the second gradient descent value is calculated to obtain a second update parameter, and then it is determined whether the first update parameter and the second update parameter meet the preset federated learning end condition. If so, the first update parameter and the second update parameter are used together as the first shared classification model parameter. If not, the gradient information is recalculated to iteratively update the first secret shared initial model parameter until the preset federated learning end condition is met. The calculation expression for calculating the first update parameter is as follows:
[0145]
[0146] Among them, δ1 is the first learning rate, is the first update parameter. Additionally, the calculation expression for calculating the second update parameter is as follows:
[0147]
[0148] Among them, δ2 is the second learning rate, is the second update parameter.
[0149] Step S313: based on the second gradient information and the preset second learning parameters, update the second secret sharing initial model parameters until the preset federated learning end condition is met, and obtain the second shared classification model parameters.
[0150] In this embodiment, it should be noted that the preset second learning parameter includes a third learning rate and a fourth learning rate.
[0151] Based on the second gradient information and the preset second learning parameter, the second secret shared initial model parameter is updated until the preset federated learning end condition is met, and the second shared classification model parameter is obtained. Specifically, the product of the third type gradient and the third learning rate is calculated to obtain a third gradient descent value, and then the difference between the second share of the first type initial model parameter of the second party and the third gradient descent value is calculated to obtain a third update parameter, and the product of the fourth type gradient and the fourth learning rate is calculated to obtain a fourth gradient descent value, and then the difference between the second share of the second type initial model parameter of the second party and the fourth gradient descent value is calculated to obtain a fourth update parameter, and then it is determined whether the third update parameter and the fourth update parameter meet the preset federated learning end condition. If so, the third update parameter and the fourth update parameter are used together as the second shared classification model parameter. If not, the gradient information is recalculated to iteratively update the second secret shared initial model parameter until the preset federated learning end condition is met, wherein the calculation expression for calculating the third update parameter is as follows:
[0152]
[0153] Wherein, δ3 is the third learning rate, is the third update parameter. Additionally, the calculation expression for calculating the fourth update parameter is as follows:
[0154]
[0155] Wherein, δ4 is the fourth learning rate, is the fourth updated parameter.
[0156] In addition, it should be noted that the second device calculates the fifth update parameter based on the fifth type of gradient and the preset fifth learning rate Based on the sixth type of gradient and the preset sixth learning rate, calculate the sixth update parameter Based on the seventh type of gradient and the preset seventh learning rate, calculate the seventh update parameter Based on the eighth type of gradient and the preset eighth learning rate, calculate the eighth update parameter The second device calculates each gradient in the same manner as the first device.
[0157] Step S32, based on the secret sharing classification model update parameters, determine the first target classification model parameters by performing decryption interaction with the second device, so that the second device can determine the second target classification model parameters.
[0158] In this embodiment, based on the secret shared classification model update parameters, the first target classification model parameters are determined by performing decryption interaction with the second device, so that the second device can determine the second target classification model parameters. Specifically, the seventh update parameter and the eighth update parameter sent by the second device are received, and the first target classification model parameters are calculated based on the first update parameter, the second update parameter, the seventh update parameter and the eighth update parameter, and the third update parameter and the fourth update parameter are sent to the second device, so that the second device can calculate the second target classification model parameters based on the third update parameter, the fourth update parameter, the fifth update parameter and the sixth update parameter.
[0159] The secret sharing classification model update parameters include a first share of model parameters updated by the first party and a second share of model parameters updated by the second party.
[0160] The step of updating the parameters based on the secret sharing classification model and determining the first target classification model parameters by performing decryption interaction with the second device so that the second device can determine the second target classification model parameters comprises:
[0161] Step S321, receiving the second share of the first party's updated model parameters determined by the second device based on the vertical federated learning modeling, and transmitting the second share of the second party's updated model parameters to the second device, so that the second device can determine the second target classification model parameters based on the first share of the second party's updated model parameters determined by the vertical federated learning modeling and the second share of the second party's updated model parameters;
[0162] In this embodiment, it should be noted that the first share of model parameters updated by the first party includes the first update parameter and the second update parameter, the second share of model parameters updated by the second party includes the third update parameter and the fourth update parameter, the first share of model parameters updated by the second party includes the fifth update parameter and the sixth update parameter, and the second share of model parameters updated by the first party includes the seventh update parameter and the eighth update parameter, wherein the first update parameter is a model parameter determined by the first device through vertical federated learning on the first share of the first party's first type initial model parameters iteratively updating, the second update parameter is a model parameter determined by the first device through vertical federated learning on the first share of the first party's second type initial model parameters iteratively updating, and the third update parameter is a model parameter determined by the first device through vertical federated learning on the first share of the second party's first type initial model parameters iteratively updating. The fourth update parameter is the model parameter determined by iteratively updating the second share of the second party's second type initial model parameters by the first device through vertical federated learning, the fifth update parameter is the model parameter determined by iteratively updating the first share of the second party's first type initial model parameters by the second device through vertical federated learning, the sixth update parameter is the model parameter determined by iteratively updating the first share of the second party's second type initial model parameters by the second device through vertical federated learning, the seventh update parameter is the model parameter determined by iteratively updating the second share of the first party's first type initial model parameters by the second device through vertical federated learning, and the eighth update parameter is the model parameter determined by iteratively updating the second share of the first party's second type initial model parameters by the second device through vertical federated learning.
[0163] Receive the second share of the first-party updated model parameters determined by the second device based on the vertical federated learning modeling, and send the second share of the second-party updated model parameters to the second device, so that the second device can determine the second target classification model parameters based on the first share of the second-party updated model parameters and the second share of the second-party updated model parameters determined by the second device based on the vertical federated learning modeling. Specifically, receive the seventh update parameter and the eighth update parameter sent by the second device, and send the third update parameter and the fourth update parameter to the second device, so that the second device can calculate the sum of the third update parameter and the fifth update parameter to obtain the second-party first-type model update parameters, calculate the sum of the fourth update parameter and the fifth update parameter to obtain the second-party second-type model update parameters, and use the second-party first-type model update parameters and the second-party second-type model update parameters together as the second target classification model parameters, wherein the calculation expression of the second-party first-type model update parameters is as follows:
[0164]
[0165] in, is the second party first type model update parameter. In addition, the calculation expression of the second party second type model update parameter is as follows:
[0166]
[0167] in, Update parameters for the second party second type model.
[0168] Step S322: Aggregate the first share of the model parameters updated by the first party and the second share of the model parameters updated by the first party to obtain the first target classification model parameters.
[0169] In this embodiment, the first share of the first-party updated model parameter and the second share of the first-party updated model parameter are aggregated to obtain the first target classification model parameter. Specifically, the sum of the first update parameter and the seventh update parameter is calculated to obtain the first-party first-type model update parameter, and the sum of the second update parameter and the eighth update parameter is calculated to obtain the first-party second-type model update parameter, and the first-party first-type model update parameter and the first-party second-type model update parameter are used together as the first target classification model parameter, wherein the calculation expression of the first-party first-type model update parameter is as follows:
[0170]
[0171] in, is the first party first type model update parameter, and in addition, the calculation expression of the first party second type model update parameter is as follows:
[0172]
[0173] in, Update parameters for the first-party second-type model.
[0174] This embodiment provides a method for updating model parameters of a vertical federated factor decomposition machine classification model based on a secret sharing classification error, that is, first, the first device updates the secret sharing initial model parameters based on the secret sharing classification error by calculating the gradient method to obtain the updated parameters of the secret sharing classification model of this iteration, and the second device simultaneously updates the second party secret sharing initial model parameters based on the second party secret sharing classification error to obtain the updated parameters of the second party secret sharing classification model of this iteration, until the preset federated learning end condition is reached, then based on the secret sharing mechanism, the first device and the second device perform decryption interaction, the first device updates the parameters based on the secret sharing classification model, assists the second device to update the parameters based on the second party secret sharing classification model, and determines the second target classification model parameters, and at the same time, the second device updates the parameters based on the second party secret sharing classification model, assists the first device to update the parameters based on the secret sharing classification model, and determines the first target classification model parameters, thereby completing the construction of the vertical federated factor decomposition machine classification model, thereby laying a foundation for overcoming the technical defect in the prior art of using a two-party federated learning method based on unencrypted or a two-party vertical federated learning modeling method based on homomorphic encryption to construct a classification model, resulting in the inability to protect the data privacy of each participant in the vertical federated learning modeling.
[0175] Further, refer to Figure 3 Based on the first and second embodiments of the present application, in another embodiment of the present application, the click rate prediction method is applied to a first device, and the click rate prediction method includes:
[0176] Step A10, performing secret sharing with the second device to obtain secret sharing user data to be predicted and secret sharing model parameters;
[0177] In this embodiment, it should be noted that the first device and the second device are both participants in the vertical federated learning, and before secret sharing, the first device and the second device have trained a preset click rate prediction model based on secret sharing and vertical federated learning, wherein the preset click rate prediction model is a trained factor decomposition machine classification model, which is used to predict the click probability of the user corresponding to the item or predict whether the user will click on the item, and then the model expression of the preset click rate prediction model is as follows:
[0178]
[0179] z(x)=<w,x> +∑ i<j <V i , V j >x i x j
[0180] Among them, x is the model input data, w and V are model parameters, and f(x) is the model output, which is the predicted click rate.
[0181] Perform secret sharing with the second device to obtain secret shared user data to be predicted and secret shared model parameters, specifically, obtain first-party click rate model parameters of a preset click rate model and first-party user data to be predicted, and at the same time, the second device obtains second-party click rate model parameters and second-party user data to be predicted of the preset click rate model, wherein, since the preset click rate model is constructed based on vertical federated learning, part of the model parameters of the preset click rate prediction model held by the first device are first-party click rate model parameters, and part of the model parameters of the preset click rate prediction model held by the second device are second-party click rate model parameters, and the first-party user data to be predicted is data of user click results on items collected by the first device, The second-party user data to be predicted is data of the user's click results on the items collected by the second device, wherein both the first-party user data to be predicted and the second-party user data to be predicted can be represented by vectors. For example, assuming that the first-party user data to be predicted is a vector (1, 0, 1, 0), wherein code 1 indicates that the user clicked on the corresponding item, and code 0 indicates that the user did not click on the corresponding item, then the vector (1, 0, 1, 0) indicates that the user clicked on item A and item C, but did not click on item B and item D. Further, based on the first-party click-through rate model parameters and the first-party user data to be predicted, secret sharing is performed with the second device, wherein the second device provides the second-party click-through rate model parameters in the secret sharing. The first device obtains the secret sharing model parameters and the secret sharing user data to be predicted, and the second device obtains the second-party secret sharing model parameters and the second-party secret sharing user data to be predicted, wherein the secret sharing model parameters include the first shared first-party model parameters and the first shared second-party model parameters, the secret sharing user data to be predicted includes the first shared first-party user data to be predicted and the first shared second-party user data to be predicted, the second-party secret sharing model parameters include the second shared first-party model parameters and the second shared second-party model parameters, and the second-party secret sharing user data to be predicted includes the second shared first-party user data to be predicted and the second shared second-party user data The first shared first-party model parameter is the first share of the first-party click-through rate model parameter, the second shared first-party model parameter is the second share of the first-party click-through rate model parameter, the first shared second-party model parameter is the first share of the second click-through rate model parameter, the second shared second-party model parameter is the second share of the second click-through rate model parameter, the first shared first-party user data to be predicted is the first share of the first-party user data to be predicted, the second shared first-party user data to be predicted is the second share of the first-party user data to be predicted, and the first shared second-party user data to be predicted is the first share of the second-party user data to be predicted,The second shared second-party user data to be predicted is a second share of the second-party user data to be predicted.
[0182] Step A20, inputting the secret sharing user data to be predicted into a preset click rate prediction model, so as to perform click rate prediction on the target user corresponding to the secret sharing user data to be predicted based on the secret sharing model parameters, and obtain a first secret sharing click rate prediction result;
[0183] In this embodiment, the secret shared user data to be predicted is input into a preset click rate prediction model, so as to perform click rate prediction on the target user corresponding to the secret shared user data to be predicted based on the secret shared model parameters, and obtain a first secret shared click rate prediction result. Specifically, the first shared first-party user data to be predicted and the first shared second-party user data to be predicted are respectively input into the preset click rate prediction model, so as to substitute the first shared first-party user data to be predicted and the first shared first-party model parameters into the model expression of the preset click rate prediction model, calculate the first shared first-party predicted click rate through secret shared multiplication, and substitute the first shared second-party user data to be predicted and the first shared second-party model parameters into the model expression of the preset click rate prediction model, calculate the first shared first-party predicted click rate through secret shared multiplication, and obtain the first secret shared click rate prediction result by substituting the first shared second-party user data to be predicted and the first shared second-party model parameters into the model expression of the preset click rate prediction model. The number is substituted into the model expression of the preset click-through rate prediction model, the first shared second-party predicted click-through rate is calculated by secret sharing multiplication, and the first shared first-party predicted click-through rate and the first shared second-party predicted click-through rate are used as the first secret sharing click-through rate prediction result, wherein the first shared first-party predicted click-through rate and the first shared second-party predicted click-through rate are both model output values. Similarly, the second device will calculate the second shared first-party predicted click-through rate by secret sharing multiplication based on the second shared first-party user data to be predicted and the second shared first-party model parameters, and calculate the second shared second-party predicted click-through rate by secret sharing multiplication based on the second shared second-party user data to be predicted and the second shared second-party model parameters.
[0184] Step A30: Based on the first secret shared click rate prediction result, perform a federated prediction interaction with the second device to calculate a target predicted click rate by combining the second secret shared click rate prediction result determined by the second device.
[0185] In this embodiment, based on the first secret shared click-through rate prediction result, a federal prediction interaction is performed with the second device to calculate the target predicted click-through rate by combining the second secret shared click-through rate prediction result determined by the second device. Specifically, based on the first secret shared click-through rate prediction result, a federal prediction interaction is performed with the second device to aggregate the first secret shared click-through rate prediction result and the second secret shared click-through rate prediction result to obtain the target predicted click-through rate.
[0186] The first secret shared click rate prediction result includes a first shared first-party predicted click rate and a first shared second-party predicted click rate, and the second secret shared click rate prediction result includes a second shared first-party predicted click rate and a second shared second-party predicted click rate.
[0187] The step of performing a federated prediction interaction with the second device based on the first secret shared click rate prediction result to calculate a target predicted click rate in conjunction with the second secret shared click rate prediction result determined by the second device comprises:
[0188] Step A31, receiving the second shared first-party predicted click rate and the second shared second-party predicted click rate sent by the second device;
[0189] Step A32, calculating the first-party predicted click rate based on the first shared first-party predicted click rate and the second shared first-party predicted click rate;
[0190] In this embodiment, the first-party predicted click-rate is calculated based on the first shared first-party predicted click-rate and the second shared first-party predicted click-rate. Specifically, the sum of the first shared first-party predicted click-rate and the second shared first-party predicted click-rate is calculated to obtain the first-party predicted click-rate.
[0191] Step A33, calculating the second-party predicted click rate based on the first shared second-party predicted click rate and the second shared second-party predicted click rate;
[0192] In summary, this embodiment, based on the first shared second-party predicted click rate and the second shared second-party predicted click rate, the second-party predicted click rate is calculated. Specifically, the sum of the first shared second-party predicted click rate and the second shared second-party predicted click rate is calculated to obtain the second-party predicted click rate.
[0193] Step A34, aggregating the first-party predicted click-through rate and the second-party predicted click-through rate to obtain the target predicted click-through rate.
[0194] In this embodiment, the first-party predicted click-through rate and the second-party predicted click-through rate are aggregated to obtain the target predicted click-through rate. Specifically, based on preset aggregation rules, the first-party predicted click-through rate and the second-party predicted click-through rate are aggregated to obtain the target predicted click-through rate, wherein the preset aggregation rules include summation and weighted averaging, etc.
[0195] In addition, it should be noted that the target predicted click-through rate is the probability of a user clicking on an item predicted based on a preset click-through rate prediction model, and then the target predicted click-through rate is compared with a preset click-through rate threshold. If the target predicted click-through rate is greater than or equal to the preset click-through rate threshold, it is determined that the user will click on the item. If the target predicted click-through rate is less than the preset click-through rate threshold, it is determined that the user will not click on the item. That is, the click prediction results of the user corresponding to the item are divided into two prediction results: click and no click.
[0196] This embodiment provides a method for predicting click-through rate based on secret sharing and vertical federated learning, wherein secret sharing is performed with a second device to obtain secret shared user data to be predicted and secret sharing model parameters, and then the secret shared user data to be predicted is input into a preset click-through rate prediction model, so as to predict the click-through rate of a target user corresponding to the secret shared user data to be predicted based on the secret sharing model parameters, and obtain a first secret shared click-through rate prediction result, and then based on the first secret shared click-through rate prediction result, a federated prediction interaction is performed with the second device to calculate the target predicted click-through rate in conjunction with the second secret shared click-through rate prediction result determined by the second device, wherein when the first device and the second device interact, the data sent or received are all secret shared data, and there is no need to encrypt the data using a public-private key generated by a third party, and all data transmission processes are performed between the two parties participating in the vertical federated learning, thereby protecting the privacy of the data and reducing the complex encryption and decryption calculation process of the data, and since only simple mathematical operations are required when performing secret sharing and decryption corresponding to secret sharing, the calculation complexity is reduced, thereby improving the calculation efficiency of the factor decomposition machine classification model when predicting the click-through rate.
[0197] Reference Figure 4 , Figure 4 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.
[0198] like Figure 4 As shown, the factor decomposition machine classification model building device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. 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.
[0199] Optionally, the factor decomposition machine classification model building device may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0200] Those skilled in the art will understand that Figure 4 The factor decomposition machine classification model building device structure shown in does not constitute a limitation of the factor decomposition machine classification model building device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0201] like Figure 4 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, and a factor decomposition machine classification model construction program. The operating system is a program that manages and controls the hardware and software resources of the factor decomposition machine classification model construction device, and supports the operation of the factor decomposition machine classification model construction program and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the factor decomposition machine classification model construction system.
[0202] exist Figure 4 In the factor decomposition machine classification model building device shown, the processor 1001 is used to execute the factor decomposition machine classification model building program stored in the memory 1005 to implement the steps of any of the above-mentioned factor decomposition machine classification model building methods.
[0203] The specific implementation of the factor decomposition machine classification model construction device of the present application is basically the same as the various embodiments of the factor decomposition machine classification model construction method mentioned above, and will not be repeated here.
[0204] Reference Figure 5 , Figure 5 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.
[0205] like Figure 5As shown, the click rate prediction device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. 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.
[0206] Optionally, the click rate prediction device may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen (Display), an input submodule such as a keyboard (Keyboard), and the optional rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0207] Those skilled in the art will understand that Figure 5 The structure of the click rate prediction device shown in the figure does not constitute a limitation on the click rate prediction device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0208] like Figure 5 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module and a click rate prediction program. The operating system is a program that manages and controls the hardware and software resources of the click rate prediction device, and supports the operation of the click rate prediction program and other software and / or programs. The network communication module is used to realize the communication between the components inside the memory 1005, and the communication with other hardware and software in the click rate prediction system.
[0209] exist Figure 5 In the click rate prediction device shown, the processor 1001 is used to execute the click rate prediction program stored in the memory 1005 to implement the steps of any of the above-mentioned click rate prediction methods.
[0210] The specific implementation of the click rate prediction device of the present application is basically the same as the above-mentioned embodiments of the click rate prediction method, and will not be repeated here.
[0211] The present application also provides a factor decomposition machine classification model construction device, which is applied to a factor decomposition machine classification model construction device, and the factor decomposition machine classification model construction device includes:
[0212] A secret sharing module, used to perform secret sharing with the second device and obtain secret sharing initial model parameters and secret sharing training data;
[0213] A vertical federation module, configured to perform vertical federated learning modeling with the second device based on the secret sharing training data, the secret sharing initial model parameters and preset weight information, and calculate the secret sharing classification error;
[0214] A determination module is used to determine the first target classification model parameters based on the secret shared classification error, and assist the second device in determining the second target classification model parameters to construct a vertical federated factorization machine classification model.
[0215] Optionally, the vertical federation module includes:
[0216] A federation interaction unit, configured to calculate the classification parameter item corresponding to the secret sharing initial model parameter and the secret sharing training data by performing a federation interaction with the second device based on a preset secret sharing mechanism;
[0217] A calculation unit is used to calculate the secret sharing classification error based on the classification parameter item, the preset weight information and the secret sharing label data.
[0218] Optionally, the computing unit includes:
[0219] a first calculation subunit, configured to calculate a first weighted item based on the classification parameter item and the first weight, and to calculate a second weighted item based on the secret shared label data and the second weight;
[0220] The second calculation subunit is used to calculate the secret sharing classification error based on the first weighted term and the second weighted term.
[0221] Optionally, the federation interaction unit includes:
[0222] A third calculation subunit is used to calculate the cross inner product between each element in the second type of shared parameter and each element in the secret sharing training data based on the secret sharing multiplication, by performing federation interaction with the second device, to obtain the cross inner product of each element;
[0223] An accumulation subunit, used for accumulating the cross inner products of each of the elements to obtain the inner product of the cross feature term of the secret sharing;
[0224] a fourth calculation subunit, configured to calculate, based on the secret sharing multiplication and the secret sharing addition, a first intermediate parameter item corresponding to the first type of shared parameter and the secret sharing training data, and calculate a second intermediate parameter item corresponding to the secret sharing cross-feature item inner product, the secret sharing training data, and the second type of shared parameter by performing federated interaction with the second device;
[0225] A determination subunit is used to determine the secret sharing intermediate parameter based on the first intermediate parameter item and the second intermediate parameter item.
[0226] Optionally, the secret sharing module includes:
[0227] an acquisition unit, configured to acquire a first-party model parameter and first-party training label data, and use a first share of the first-party model parameter as the first shared parameter;
[0228] A first sending unit, configured to send a second share of the first-party model parameter to the second device, so that the second device can determine a third shared parameter;
[0229] A first receiving unit, configured to receive a second shared parameter sent by the second device, wherein the second shared parameter is a second share of a second-party model parameter acquired by the second device, and the first share of the second-party model parameter is a fourth shared parameter of the second device;
[0230] A second sending unit, configured to use the first share of the first-party training label data as the first shared training data, and send the second share of the first-party training label data to the second device, so that the second device determines third shared training data;
[0231] The second receiving unit is used to receive second shared training data sent by the second device, wherein the second shared training data is a second share of the second-party training data acquired by the second device, and the first share of the second-party training data is fourth shared training data of the second device.
[0232] Optionally, the determining module includes:
[0233] An updating unit, configured to update the secret sharing initial model parameters based on the secret sharing classification error to obtain the secret sharing classification model parameters;
[0234] A decryption unit is used to determine the first target classification model parameters based on the secret shared classification model parameters by performing decryption interaction with the second device, so that the second device can determine the second target classification model parameters.
[0235] Optionally, the updating unit includes:
[0236] a fifth calculation subunit, configured to calculate first gradient information of the secret sharing classification error with respect to the first secret sharing initial model parameter, and calculate second gradient information of the secret sharing classification error with respect to the second secret sharing initial model parameter;
[0237] A first updating subunit is configured to update the first secret sharing initial model parameters based on the first gradient information and the preset first learning parameters until a preset federated learning end condition is met to obtain the first shared classification model parameters;
[0238] The second updating subunit is used to update the second secret sharing initial model parameters based on the second gradient information and the preset second learning parameters until the preset federated learning end condition is met to obtain the second shared classification model parameters.
[0239] Optionally, the decryption unit includes:
[0240] a receiving subunit, configured to receive a second share of the first party's updated model parameters determined by the second device based on the longitudinal federated learning modeling, and transmit the second share of the second party's updated model parameters to the second device, so that the second device can determine the second target classification model parameters based on the first share of the second party's updated model parameters and the second share of the second party's updated model parameters determined by the longitudinal federated learning modeling;
[0241] An aggregation subunit is used to aggregate the first share of the model parameters updated by the first party and the second share of the model parameters updated by the first party to obtain the first target classification model parameters.
[0242] The specific implementation of the factor decomposition machine classification model construction device of the present application is basically the same as the various embodiments of the factor decomposition machine classification model construction method mentioned above, and will not be repeated here.
[0243] The embodiment of the present application further provides a click rate prediction device, which is applied to a click rate prediction device, and the click rate prediction device includes:
[0244] A secret sharing module, used to perform secret sharing with the second device, and obtain secret sharing user data to be predicted and secret sharing model parameters;
[0245] A prediction module, used for inputting the secret sharing user data to be predicted into a preset click rate prediction model, so as to perform click rate prediction on a target user corresponding to the secret sharing user data to be predicted based on the secret sharing model parameters, and obtain a first secret sharing click rate prediction result;
[0246] A joint calculation module is used to perform a federal prediction interaction with the second device based on the first secret shared click rate prediction result, so as to calculate a target predicted click rate by combining the second secret shared click rate prediction result determined by the second device.
[0247] Optionally, the joint calculation module includes:
[0248] a receiving unit, configured to receive the second shared first-party predicted click rate and the second shared second-party predicted click rate sent by the second device;
[0249] A first calculation unit, configured to calculate a first-party predicted click rate based on the first shared first-party predicted click rate and the second shared first-party predicted click rate;
[0250] a second calculation unit, configured to calculate a second-party predicted click rate based on the first shared second-party predicted click rate and the second shared second-party predicted click rate;
[0251] An aggregation unit is used to aggregate the first-party predicted click-through rate and the second-party predicted click-through rate to obtain the target predicted click-through rate.
[0252] The specific implementation of the click rate prediction device of the present application is basically the same as the above-mentioned embodiments of the click rate prediction method, and will not be repeated here.
[0253] An embodiment of the present application provides a readable storage medium, and the readable storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of the factor decomposition machine classification model construction method described in any one of the above items.
[0254] The specific implementation of the readable storage medium of the present application is basically the same as the various embodiments of the above-mentioned factor decomposition machine classification model construction method, and will not be repeated here.
[0255] An embodiment of the present application provides a readable storage medium, and the readable storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of any of the above-mentioned click-through rate prediction methods.
[0256] The specific implementation of the readable storage medium of the present application is basically the same as the above-mentioned embodiments of the click rate prediction method, and will not be repeated here.
[0257] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A method for constructing a factor decomposition machine classification model, characterized in that: The factor decomposition machine classification model construction method is applied to a first device, and the factor decomposition machine classification model construction method includes: Perform secret sharing with the second device to obtain secret sharing initial model parameters and secret sharing training data; Based on the secret sharing training data, the secret sharing initial model parameters and preset weight information, perform longitudinal federated learning modeling with the second device to calculate the secret sharing classification error; Determine first target classification model parameters based on the secret shared classification error, and assist the second device in determining second target classification model parameters to construct a vertical federated factorization machine classification model; The secret sharing training data includes secret sharing label data, and the step of performing longitudinal federated learning modeling with the second device based on the secret sharing training data, the secret sharing initial model parameters and preset weight information, and calculating the secret sharing classification error includes: Based on a preset secret sharing mechanism, by performing federated interaction with the second device, calculating a classification parameter item corresponding to the secret sharing initial model parameter and the secret sharing training data; The secret sharing classification error is calculated based on the classification parameter item, the preset weight information and the secret sharing label data.
2. The method for constructing a factorization machine classification model according to claim 1, characterized in that: The preset weight information includes a first weight and a second weight, The step of calculating the secret sharing classification error based on the classification parameter item, the preset weight information and the secret sharing label data comprises: Calculating a first weighted item based on the classification parameter item and the first weight, and calculating a second weighted item based on the secret shared label data and the second weight; The secret sharing classification error is calculated based on the first weighted term and the second weighted term.
3. The method for constructing a factorization machine classification model according to claim 1, characterized in that: The secret sharing initial model parameters include first type sharing parameters and second type sharing parameters, the classification parameter items include secret sharing intermediate parameters, the preset secret sharing mechanism includes secret sharing multiplication, The step of calculating the classification parameter items corresponding to the secret sharing initial model parameters and the secret sharing training data based on the preset secret sharing mechanism by performing federated interaction with the second device comprises: Based on the secret sharing multiplication, by performing federated interaction with the second device, a cross inner product between each element in the second type of shared parameter and each element in the secret sharing training data is calculated to obtain a cross inner product of each element; Accumulating the cross inner products of each of the elements to obtain the cross feature item inner product of the secret sharing; Based on the secret sharing multiplication and the secret sharing addition, by performing federated interaction with the second device, a first intermediate parameter item corresponding to the first type of shared parameter and the secret sharing training data is calculated, and a second intermediate parameter item corresponding to the secret sharing cross-characteristic item inner product, the secret sharing training data, and the second type of shared parameter is calculated; The secret sharing intermediate parameter is determined based on the first intermediate parameter item and the second intermediate parameter item.
4. The method for constructing a factorization machine classification model according to claim 1, characterized in that: The secret sharing model parameters include a first sharing parameter and a second sharing parameter, and the secret sharing training data include a first sharing training data and a second sharing training data. The step of performing secret sharing with the second device and obtaining secret sharing model parameters and secret sharing training data comprises: Acquire a first-party model parameter and first-party training label data, and use a first share of the first-party model parameter as the first shared parameter; sending a second share of the first party model parameter to the second device for the second device to determine a third shared parameter; receiving a second shared parameter sent by the second device, wherein the second shared parameter is a second share of a second-party model parameter acquired by the second device, and the first share of the second-party model parameter is a fourth shared parameter of the second device; Using the first share of the first-party training label data as the first shared training data, and sending the second share of the first-party training label data to the second device so that the second device can determine third shared training data; Second shared training data sent by the second device is received, wherein the second shared training data is a second share of second-party training data acquired by the second device, and the first share of the second-party training data is fourth shared training data of the second device.
5. The method for constructing a factorization machine classification model according to claim 1, characterized in that: The step of determining the first target classification model parameters based on the secret shared classification error and assisting the second device in determining the second target classification model parameters comprises: Based on the secret sharing classification error, updating the secret sharing initial model parameters to obtain the secret sharing classification model parameters; Based on the secret shared classification model parameters, the first target classification model parameters are determined by performing a decryption interaction with the second device, so that the second device can determine the second target classification model parameters.
6. The method for constructing a factorization machine classification model according to claim 5, characterized in that: The secret sharing model parameters include a first secret sharing initial model parameter and a second secret sharing initial model parameter, and the secret sharing classification model update parameters include a first shared classification model parameter and a second shared classification model parameter. The step of updating the secret sharing initial model parameters based on the secret sharing classification error to obtain the secret sharing classification model parameters comprises: Calculating first gradient information of the secret shared classification error with respect to the first secret shared initial model parameter, and calculating second gradient information of the secret shared classification error with respect to the second secret shared initial model parameter; Based on the first gradient information and the preset first learning parameters, the first secret sharing initial model parameters are updated until a preset federated learning end condition is met, thereby obtaining the first shared classification model parameters; Based on the second gradient information and the preset second learning parameters, the second secret sharing initial model parameters are updated until the preset federated learning end condition is met, and the second shared classification model parameters are obtained.
7. The method for constructing a factorization machine classification model according to claim 5, characterized in that: The secret shared classification model parameters include a first share of model parameters updated by a first party and a second share of model parameters updated by a second party, The step of determining the first target classification model parameters based on the secret shared classification model parameters by performing decryption interaction with the second device so that the second device can determine the second target classification model parameters comprises: Receive the second share of the first party's updated model parameters determined by the second device based on the longitudinal federated learning modeling, and transmit the second share of the second party's updated model parameters to the second device, so that the second device can determine the second target classification model parameters based on the first share of the second party's updated model parameters and the second share of the second party's updated model parameters determined by the longitudinal federated learning modeling; Aggregate the first share of the model parameters updated by the first party and the second share of the model parameters updated by the first party to obtain the first target classification model parameters.
8. A click rate prediction method, characterized in that: The click rate prediction method is applied to a first device, and the click rate prediction method includes: Perform secret sharing with the second device to obtain secret sharing user data to be predicted and secret sharing model parameters; Inputting the secret shared user data to be predicted into a preset click rate prediction model, so as to predict the click rate of the target user corresponding to the secret shared user data to be predicted based on the secret shared model parameters, and obtain a first secret shared click rate prediction result, wherein the preset click rate prediction model is a vertical federated factor decomposition machine classification model constructed by the method according to any one of claims 1 to 7; Based on the first secret shared click rate prediction result, a federal prediction interaction is performed with the second device to calculate a target predicted click rate in conjunction with the second secret shared click rate prediction result determined by the second device.
9. The click rate prediction method according to claim 8, characterized in that: The first secret shared click rate prediction result includes a first shared first-party predicted click rate and a first shared second-party predicted click rate, and the second secret shared click rate prediction result includes a second shared first-party predicted click rate and a second shared second-party predicted click rate. The step of performing a federated prediction interaction with the second device based on the first secret shared click rate prediction result to calculate a target predicted click rate in conjunction with the second secret shared click rate prediction result determined by the second device comprises: Receiving the second shared first-party predicted click rate and the second shared second-party predicted click rate sent by the second device; Calculating a first-party predicted click rate based on the first shared first-party predicted click rate and the second shared first-party predicted click rate; Calculating a second-party predicted click rate based on the first shared second-party predicted click rate and the second shared second-party predicted click rate; The first-party predicted click-through rate and the second-party predicted click-through rate are aggregated to obtain the target predicted click-through rate.
10. A factor decomposition machine classification model building device, characterized in that: The factor decomposition machine classification model construction device includes: a memory, a processor, and a program stored in the memory for implementing the factor decomposition machine classification model construction method. The memory is used to store a program for implementing a factorization machine classification model construction method; The processor is used to execute a program for implementing the factor decomposition machine classification model construction method to implement the steps of the factor decomposition machine classification model construction method as described in any one of claims 1 to 7.
11. A readable storage medium, characterized in that: The readable storage medium stores a program for implementing a factor decomposition machine classification model construction method, and the program for implementing a factor decomposition machine classification model construction method is executed by a processor to implement the steps of the factor decomposition machine classification model construction method as described in any one of claims 1 to 7.
12. A click rate prediction device, characterized in that: The click rate prediction device comprises: a memory, a processor, and a program stored in the memory for implementing the click rate prediction method. The memory is used to store a program for implementing a click rate prediction method; The processor is used to execute a program for implementing the click rate prediction method to implement the steps of the click rate prediction method as described in any one of claims 8 to 9.
13. A readable storage medium, characterized in that: The readable storage medium stores a program for implementing the click rate prediction method, and the program for implementing the click rate prediction method is executed by a processor to implement the steps of the click rate prediction method as described in any one of claims 8 to 9.
Citation Information
Patent Citations
Model parameter training method and device based on federal learning
CN110288094A
Private data processing method and device
CN110955915A