Longitudinal federal service recommendation method based on deep learning and factorization machine
By introducing deep learning and factorization machine models into vertical federated service recommendation, combined with privacy set intersection and encryption technology, the application difficulty of the vertical federated factorization machine algorithm in the one-to-one scenario of user data of both parties is solved, and a better solution is achieved. Data alignment and communication optimization improve the service recommendation effect.
Patent Information
- Application Number
- CN202410638597.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-09-06
AI Technical Summary
The existing vertical federated factorization machine algorithm is difficult to apply in a one-to-one scenario of user data of both parties. The communication overhead is affected by the feature dimension of the original data, and can only be used in a one-to-one scenario of user data of both parties. It is difficult to expand the application scenarios and Improve performance.
A longitudinal federated service recommendation method based on deep learning and factorization machines is adopted. By introducing a trusted third party, the privacy set intersection technology is used to align user data, and the attention model and encryption technology are combined to extract deep data features and use longitudinal federated factors. The decomposition machine algorithm performs ciphertext data interaction and calculation, and updates deep learning and factorization machine model parameters.
It expands the application scenarios of the vertical federated factorization machine algorithm, improves the effect of service recommendation, mines more data value, optimizes communication overhead, and achieves data alignment in multiple data scenarios.
Smart Images

Figure CN118606987A
Abstract
Description
Technical Field
[0001] The present invention relates to a vertical federated service recommendation method, and in particular to a vertical federated service recommendation method based on deep learning and factor decomposition machine, belonging to the technical field of service computing and service recommendation. Background Art
[0002] Federated learning can exchange data value without sharing the original data. Its application in service recommendation can effectively alleviate the data gap between different service providers to provide better service recommendations. There are many federated algorithms. Among them, the vertical federated factorization machine algorithm is simple to implement and works well on sparse data. However, it still has some problems: (1) It is difficult to improve the performance of the vertical federated factorization machine algorithm; (2) In the vertical federation scenario, the communication overhead of the vertical federated factorization machine algorithm is mainly affected by the feature dimension of the original data and is difficult to further optimize; (3) The vertical federated factorization machine algorithm can only be applied in the one-to-one scenario of user data of both parties.
[0003] In summary, there is a need for a method that can extract raw data features and convert the data scenario situations of both parties into a one-to-one vertical federated service recommendation method. Summary of the invention
[0004] A brief overview of the present invention is provided below in order to provide a basic understanding of certain aspects of the present invention. It should be understood that this overview is not an exhaustive overview of the present invention. It is not intended to identify key or important parts of the present invention, nor is it intended to limit the scope of the present invention. Its purpose is merely to present certain concepts in a simplified form as a prelude to a more detailed description discussed later.
[0005] In view of this, in order to solve the problem that the traditional vertical federation factor decomposition machine algorithm in the prior art cannot be applied to the one-to-one scenario of user data of both parties, the present invention provides a vertical federation service recommendation method based on deep learning and factor decomposition machine, comprising the following steps:
[0006] S1. When service providers need to jointly complete the service recommendation task through federated learning, the service providers introduce a trusted third party through negotiation;
[0007] S2. The service providers use the privacy set intersection technology to intersect the user sample data of both parties through a trusted third party to obtain the common user space of both parties, and align the users between the service providers;
[0008] S3. The service provider uses the local deep learning model to process the user sample data and extracts deep data features through the attention model and factorization machine model to obtain intermediate results;
[0009] S4. The service provider encrypts the intermediate result, interacts with the ciphertext data based on the vertical federated factorization machine algorithm and calculates to obtain the ciphertext state calculation result;
[0010] S5. The ciphertext data is sent back to the service provider, which decrypts the ciphertext state calculation results through masking technology to obtain the actual prediction results and forward gradients and update the parameters of the local deep learning model and factor decomposition machine model.
[0011] Furthermore, in S2, the same user of both service providers uses the same user number u_id, and the two service providers negotiate a data alignment standard, which is a generation standard for multiple synthetic data numbers d_id of the same user.
[0012] Furthermore, in S3, the service providers use the deep learning model to perform local calculations locally. When some users have multiple data locally and there is no one-to-one relationship between the local data entries and the data entries of the users in the partner, that is, the data cannot be used as the alignment object through the privacy set intersection technology, the attention model in the deep learning model is called to align the data, and the user number u_id is used as a reference to synthesize the multiple data or features of the user, change the number of data or feature entries, form data alignment, and obtain an intermediate result;
[0013] The attention model is used to align data, including: (1) both service providers use a local attention model to combine multiple data of the same user into one piece of data; (2) the labeled party in the service provider synchronizes the number of data entries owned by each local user to the other party, and the other party changes the number of data entries through the attention model for alignment.
[0014] Furthermore, in S4, the trusted third party generates an encrypted ciphertext that satisfies additive homomorphism and transmits it to the service provider. The service provider encrypts the intermediate result and obtains the ciphertext state calculation result based on the vertical federated factorization machine algorithm combined with the encrypted intermediate result. The ciphertext state calculation result includes the prediction result, loss and forward gradient.
[0015] Furthermore, in S5, the ciphertext data is transmitted back to the service provider, and the service provider further calculates the parameter gradient of the factor decomposition machine model and the back propagation gradient of the deep learning model in the ciphertext state locally using the forward gradient, and obtains the masked prediction result and forward gradient from a trusted third party through the mask technology. After removing the mask locally, the actual prediction result and forward gradient can be obtained, and the factor decomposition machine model is updated through the parameter gradient, and the deep learning model is updated through the back propagation gradient.
[0016] The beneficial effects of the present invention are as follows: The present invention provides a vertical federated service recommendation method based on deep learning and factor decomposition machine. The service provider uses deep learning locally to process user data and extract deep data features, thereby introducing deep learning technology based on the traditional federated factor decomposition machine algorithm, expanding the algorithm application scenarios, mining more data value, and improving the effect of service recommendation. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0018] Figure 1 A flowchart of a vertical federated service recommendation method based on deep learning and factorization machine;
[0019] Figure 2 This is a schematic diagram of the vertical federated learning algorithm framework;
[0020] Figure 3 Schematic diagram of the deep learning model and attention model structure. DETAILED DESCRIPTION
[0021] In order to make the technical solutions and advantages of the embodiments of the present invention more clearly understood, the exemplary embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0022] refer to Figure 1-3 The present embodiment is described in detail, a method for recommending vertical federated services based on deep learning and factorization machine, specifically comprising the following steps:
[0023] S1. When service providers need to jointly complete the service recommendation task through federated learning, the service providers introduce a trusted third party through negotiation;
[0024] S2. The service providers use the privacy set intersection technology to intersect the user sample data of both parties through a trusted third party to obtain the common user space of both parties, and align the users between the service providers;
[0025] S3. The service provider uses the local deep learning model to process the user sample data and extracts deep data features through the attention model and factorization machine model to obtain intermediate results;
[0026] S4. The service provider encrypts the intermediate results, calculates based on the vertical federated factorization machine algorithm combined with ciphertext data interaction, and obtains the ciphertext state calculation results;
[0027] S5. The ciphertext data is sent back to the service provider. The service provider decrypts the ciphertext state calculation results through the masking technology to obtain the actual prediction results and the forward gradients, and updates the parameters of the local deep learning model and the factorization machine model;
[0028] Specifically, to protect the privacy of data, service provider A and service provider B jointly train a multi-layer perceptron model for service recommendation through federated learning technology. Both service provider A and service provider B have partial user data, and there are many overlapping users between them, that is, the common user space U of the two service providers, U = {u i |0 ≤ i < N}, where u i is the user, i is the number of users, and a user may have more than one piece of data in the two service providers. Taking user u i as an example, service provider A locally stores the first dataset D i of m feature fields of user u iA , D iA = D iA1 , D iA2 , D iA3 , …, where, Service provider B locally stores the second dataset D i of n feature fields of user u iB , D iB = D iB1 , D iB2 , D iB3 , …, where, And there is no obvious one-to-one correspondence between the data entries in the first dataset D iA and the second dataset D iB ;
[0029] Both service provider A and service provider B have and initialize a deep learning model. Among them, service provider A has the first local attention model att A (*), the first local deep model W A (*), and the first factorization machine model FM A (*), and service provider B has the second local attention model att B (*), the second local deep model W B (*), and the second factorization machine model FM B (*). At the same time, service provider A has the learning label y;
[0030] In S1, service provider A and service provider B introduce a trusted third party through negotiation. Based on the federated learning industrialization platform, the trusted third party can be implemented through a fixed program. The fixed third party can complete operations such as additive homomorphic encryption key generation, key transmission, and ciphertext decryption. When service recommendation task learning is required, the trusted third party will generate a set of additive homomorphic encryption keys (pk t ,sk t ), where pk t is the public key, sk t is the private key, and the public key pk used for encryption t Transmitted to Service Provider A and Service Provider B.
[0031] Furthermore, in S2, the same user of both service providers uses the same user number u_id, and the two service providers negotiate a data alignment standard, which is a generation standard of multiple synthetic data numbers d_id of the same user;
[0032] Specifically, service provider A and service provider B intersect their user samples through the privacy set intersection technology, and determine whether they are common users through the number field of the same user number u_id, and finally obtain the common user space U of the two service providers, and use the user data in the user space U as the data set. At the same time, the two parties negotiate that for the same user, if both parties have only one piece of data locally, the two pieces of data will be aligned. If service provider B has more than one piece of data and service provider A has k pieces of data, through negotiation between the two parties, the number of data of service provider A with labels is used as the alignment standard, and service provider B locally synthesizes multiple pieces of data or features into k pieces of data or features.
[0033] Further, in said S3, the service providers respectively use the deep learning model to perform local calculations locally. When some users have multiple data locally and there is no one-to-one relationship between the local data entries and the data entries of the users in the partner, that is, the data cannot be used as the alignment object through the privacy set intersection technology, the attention model in the deep learning model is called to perform data alignment, and the user number u_id is used as the reference to synthesize the multiple data or features of the user, change the number of entries of the data or features, form data alignment, form data alignment, and obtain intermediate results for subsequent federated learning calculations. The attention model, as part of the deep learning model, participates in the overall learning;
[0034] The data alignment using the attention model includes: (1) both service providers combine multiple data of the same user into one data piece through the local attention model; (2) the service provider with the label synchronizes the number of data entries of each user locally to the other service provider, and the other service provider changes the number of data entries through the attention model for alignment;
[0035] Specifically, for service provider A, the original data is input into the attention model in the local deep learning model to obtain the first deep feature rA, rA = W A (att A (D iA ));
[0036] For service provider B, the original data is input into the attention model, and the user data is synthesized into attention data att according to the amount of data owned by different users and the negotiation results during alignment. B (D iB ), and then the attention data att B (D iB ) is input into the local deep learning model to obtain the second deep feature rB, rB=W B (att B (D iB ));
[0037] The first depth feature rA and the second depth feature rB are intermediate results;
[0038] refer to Figure 2 , Data is data, Feature is feature, predict result is prediction result, aligned is alignment, FC is the fully connected layer network in the deep learning neural network, FM is the factorization machine model, and Deep Feature is the deep feature.
[0039] Furthermore, in S4, the trusted third party generates an encrypted ciphertext that satisfies additive homomorphism and transmits it to the service provider. The service provider encrypts the intermediate result and obtains the ciphertext state calculation result based on the vertical federated factorization machine algorithm combined with the encrypted intermediate result. The ciphertext state calculation result includes the prediction result, loss and forward gradient.
[0040] Specifically, service provider A and service provider B use public keys pk t Encrypt the first deep feature rA and the second deep feature rB to obtain the encrypted first intermediate result [[rA]] and the second intermediate result [[rB]], and combine the federated factor decomposition machine model and the ciphertext state calculation result calculated by the vertical federated factor decomposition machine algorithm in the ciphertext state
[0041] Ciphertext status calculation results It is expressed as:
[0042]
[0043] Among them, FM A is the factorization machine model of service provider A, FM B is the factorization machine model of service provider B;
[0044] Calculate the loss [[loss]] based on the loss function Loss(*) and the learning label y;
[0045] The loss is expressed as:
[0046]
[0047] Forward gradient [[g f ]] refers to the calculation result of the final loss function on the ciphertext state The gradient of the calculation is obtained by service provider A, and service provider B synchronizes these calculation results with the encrypted ciphertext state. Further calculation is performed to obtain the parameter gradient [[gA]] of the factorization machine model of service provider A, the parameter gradient [[gB]] of the factorization machine model of service provider B, the residual [[lA]] of the deep learning model of service provider A, i.e., the back propagation gradient of the deep learning model of service provider A, and the residual [[lB]] of the deep learning model of service provider B, i.e., the back propagation gradient of the deep learning model of service provider B;
[0048] The parameter gradient [[gA]] of the factorization machine model of service provider A is expressed as:
[0049]
[0050] The parameter gradient [[gB]] of the factorization machine model of service provider B is expressed as:
[0051]
[0052] The residual [[lA]] of the deep learning model of service provider A is expressed as:
[0053] [[lA]]=η[[g A ]]
[0054] The residual [[lB]] of the deep learning model of service provider B is expressed as:
[0055] [[lB]]=η[[g B ]]
[0056] Among them, η is the amplitude parameter for local optimization of the local deep learning model and attention model of each service provider. The larger the amplitude parameter η, the larger the residual and the larger the step size of the local model parameter optimization.
[0057] Furthermore, in S5, the ciphertext data is transmitted back to the service provider, and the service provider further calculates the parameter gradient of the factor decomposition machine model and the back propagation gradient of the deep learning model in the ciphertext state locally using the forward gradient, obtains the masked prediction result and forward gradient from the trusted third party through the masking technology, and obtains the actual prediction result and forward gradient after removing the mask locally, and updates the factor decomposition machine model through the parameter gradient, and updates the deep learning model through the back propagation gradient;
[0058] Specifically, service provider A obtains the masked first gradient original gA and other originals from a trusted third party by adding a mask. Specifically, taking the first gradient original gA as an example, service provider A generates a random number randn locally and uses the public key pk t Encrypt it to obtain an encrypted random number [[randn]], then add the parameter gradient [[gA]] of the factorization machine model of service provider A and the encrypted random number [[randn]] to obtain the encrypted forward gradient [[gA+randn]] calculated in the ciphertext state, and pass the ciphertext to the trusted third party, which decrypts to obtain gA+randn and returns it. In this way, A can obtain the original gradient by subtracting randn, while the trusted third party cannot obtain the real gradient;
[0059] After obtaining the first gradient text gA, i.e., the parameter gradient of the factor decomposition machine model of the local service provider A according to the above method, the relevant parameters of the factor decomposition machine model of the local service provider A are updated. After obtaining the residual text lA of the deep learning model of the service provider A, the residual text lA of the deep learning model of the service provider A is brought into the deep learning model according to the error back propagation algorithm and back propagated layer by layer through the back propagation update method, and the deep model parameter gradient is further calculated locally to update the deep learning model parameters;
[0060] Similarly, service provider B obtains the second gradient text gB and the residual text lB of the deep learning model of service provider B by adding a mask, while the trusted third party cannot obtain the real data. Service provider B uses the second gradient gB locally to update the relevant parameters of the local factorization machine model of service provider B, and uses the residual text lB of the deep learning model of service provider B to update the deep learning model parameters of service provider B through back propagation.
[0061] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.
Claims
1. A method for recommending vertical federated services based on deep learning and factorization machine, characterized in that: The following steps are involved: S1. When service providers need to jointly complete the service recommendation task through federated learning, the service providers introduce a trusted third party through negotiation; S2. The service providers intersect their user sample data through the privacy set intersection technology to obtain the common user space of both parties, and align the users between the service providers; S3. The service provider uses deep learning locally to process user data and extract deep features of the data to obtain intermediate results; S4. The service provider encrypts the intermediate result, interacts with the ciphertext data based on the vertical federated factorization machine algorithm and calculates to obtain the ciphertext state calculation result; S5. The ciphertext data is sent back to the service provider, and the service provider decrypts the ciphertext state calculation result through masking technology to obtain the actual prediction result and forward gradient.
2. According to claim 1, a method for recommending vertical federated services based on deep learning and factorization machine, characterized in that: In S2, the same user of both service providers uses the same user ID u_id, and the two service providers negotiate a data alignment standard, which is a generation standard for multiple synthetic data IDs d_id of the same user.
3. A method for recommending vertical federated services based on deep learning and factorization machine according to claim 2, characterized in that: In S3, the service providers use the deep learning model to perform local calculations locally. When some users have multiple data locally and there is no one-to-one relationship between the local data entries and the data entries of the users in the partner, that is, the data cannot be used as the alignment object through the privacy set intersection technology, the attention model in the deep learning model is called to align the data. Based on the user number u_id, the multiple data or features of the user are synthesized, the number of data or feature entries is changed, and data alignment is formed to obtain an intermediate result. The data alignment performed by the attention model includes: (1) both service providers combine multiple pieces of data of the same user into one piece of data through a local attention model; (2) The party with the label in the service provider synchronizes the number of data entries owned by each user locally to the other party, and the other party changes the number of data entries through the attention model for alignment.
4. A method for recommending vertical federated services based on deep learning and factorization machine according to claim 3, characterized in that: In S4, the trusted third party generates an encrypted ciphertext that satisfies additive homomorphism and transmits it to the service provider. The service provider encrypts the intermediate result and obtains the ciphertext state calculation result based on the vertical federated factorization machine algorithm combined with the encrypted intermediate result. The ciphertext state calculation result includes the prediction result, loss and forward gradient.
5. A method for recommending vertical federated services based on deep learning and factorization machine according to claim 4, characterized in that: In S5, the ciphertext data is transmitted back to the service provider, which further calculates the parameter gradient of the factor decomposition machine model and the back propagation gradient of the deep learning model in the ciphertext state locally using the forward gradient, obtains the masked prediction result and forward gradient from the trusted third party through the mask technology, and obtains the actual prediction result and forward gradient after removing the mask locally, and updates the factor decomposition machine model through the parameter gradient, and updates the deep learning model through the back propagation gradient.
Citation Information
Cited By
Lightweight data security aggregation method, device and system
CN118862135A
