Service recommendation method based on longitudinal federal multilayer perceptron and continuous learning
Through vertical federated multi-layer perceptron and continuous learning, combined with privacy set intersection and encryption technology, the problem that the service recommendation system cannot utilize data from multiple service providers is solved, improving the recommendation effect and ensuring data security.
Patent Information
- Application Number
- CN202410638595.7
- 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
Existing service recommendation systems cannot make full use of all the data of the same user across multiple service providers, resulting in limited recommendation effects and risks of privacy leakage and data abuse.
Adopt a service recommendation method based on vertical federated multi-layer perceptron and continuous learning, introduce privacy set intersection technology through a trusted third party, obtain the common user space of both parties, use a dynamically structured multi-layer perceptron to calculate intermediate results, and encrypt and masking technology to ensure the privacy and security of data transmission.
It realizes the safe utilization of data from multiple service providers, improves the service recommendation effect, ensures the privacy and security of data transmission, and is suitable for the recommendation of new users and new items.
Smart Images

Figure CN118606986A
Abstract
Description
Technical Field
[0001] The present invention relates to a service recommendation method, in particular to a service recommendation method based on a vertical federated multi-layer perceptron and continuous learning, belonging to the technical field of service computing and service recommendation. Background Art
[0002] The service recommendation system can mine deep information from user data and infer user preferences. By continuously making recommendations on multiple recommendation tasks, it can provide users with a better recommendation experience and reduce a lot of computing costs for service providers. Most existing service recommendation systems are based on centralized scenarios, that is, a single service provider uses local data to continuously learn and make recommendations to users. This makes the effectiveness of the recommendation system limited to the data of a single service provider and cannot fully utilize the data of the same user in multiple service providers.
[0003] In the prior art, collaborative filtering-based service recommendation algorithms can make recommendations based on user behavior data or item attributes by calculating the similarity between users or items; content filtering-based service recommendation algorithms can match item attributes or features with user historical preferences to recommend items similar to items that the user liked in the past; deep learning-based service recommendation algorithms use neural network models to model user behavior data or item features and make recommendations by learning complex nonlinear relationships; label-based recommendation algorithms use user labels for items to make recommendations, which can be user-defined labels or system-provided labels; however, the above algorithms have the following problems: (1) For most users and items, user behavior data is very sparse, making it difficult for the recommendation algorithm to accurately capture user preferences; (2) For new users or new items, the recommendation algorithm often cannot provide accurate recommendations due to the lack of sufficient historical data; (3) The recommendation algorithm needs to analyze the user's personal data, which may lead to privacy leakage and data abuse.
[0004] In summary, a service recommendation method is needed that has transmission privacy and can obtain all data of the same user in multiple service providers. Summary of the invention
[0005] 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.
[0006] In view of this, in order to solve the problem that the traditional service recommendation algorithm in the prior art cannot fully utilize all the data of the same user in multiple service providers, the present invention provides a service recommendation method based on vertical federated multi-layer perceptron and continuous learning.
[0007] The technical solution is as follows: A service recommendation method based on a vertical federated multi-layer perceptron and continuous learning, comprising the following steps:
[0008] S1. When a recommendation task requires federated learning training or reasoning, the service provider introduces a trusted third party through negotiation;
[0009] S2. The service providers use the privacy set intersection technology through a trusted third party to intersect the user samples between the two parties and obtain the common user space of both parties;
[0010] S3. Each service provider uses local data related to samples in a common user space as a data set, and uses a multi-layer perceptron with a dynamic structure to calculate intermediate results based on the common user space;
[0011] S4. The service provider encrypts the intermediate results and obtains the calculation results and the returned gradients through ciphertext data interaction;
[0012] S5. Send the encrypted data back to the service provider, and the service provider obtains the actual calculation results and the returned gradient through masking technology.
[0013] Furthermore, the step S3 includes the following steps:
[0014] S31. When the current calculation is the training or reasoning of the first recommendation task, the data set is put into a conventional multi-layer perceptron to produce a pre-trained model to obtain a pre-trained model;
[0015] S32. When the current calculation is training or reasoning for a newly added recommendation task, the data set is put into a multi-layer perceptron with a dynamic structure, i.e., a pre-training model, the dynamic structure is cyclically screened, and an intermediate result is obtained based on the pre-training model training;
[0016] In the S32, the gradient of each parameter of the conventional multilayer perceptron after each round of training is accumulated during the cyclic screening of the dynamic structure. After a small number of iterations of samples in the data set, the parameter with the smallest absolute value in the partially accumulated gradient is recorded as a fixed structure parameter, and the fixed structure parameter is restored to the corresponding pre-trained model parameter, and does not participate in the gradient update in the subsequent training cycle iteration. The above operation is recorded as one screening, and then the remaining parameters that are not marked as fixed structure parameters are screened. After several screenings, the parameters participating in the gradient update are recorded as dynamic structure parameters;
[0017] After cyclically screening the dynamic structure, the dynamic structure model is obtained, the pre-trained model parameters are restored, and it is trained on the data set. Only the gradients related to the dynamic structure parameters are calculated and the dynamic structure parameters are updated. After several rounds of iterations, the training or inference of the newly added recommendation task is completed and the intermediate results are obtained.
[0018] Furthermore, in S4, the trusted third party generates an encrypted ciphertext that satisfies additive homomorphism and transmits it to the service provider. The high-level parameters of the multi-layer perceptron model of the service provider are scaled and offset according to the layers based on different service provider combinations, and the calculation result of the ciphertext is obtained by interacting with the ciphertext data in combination with the encrypted intermediate result. If the above calculation process is required for task training, the return gradient under the ciphertext is obtained;
[0019] The high-level parameters of the multilayer perceptron model of the service provider are scaled and offset, that is, for the fully connected layer closest to the output of the multilayer perceptron model, all weight parameters in it are uniformly scaled and offset according to the layer, and the coefficients of the scaling and offset changes are used as learnable parameters, while the original weight parameters of the multilayer perceptron model are not used as updateable parameters.
[0020] Furthermore, in S5, after receiving the ciphertext, the service provider obtains the masked calculation results and return gradients from the trusted third party through masking technology, and obtains the actual calculation results and return gradients after removing the masks locally. If the above calculation process is required for task training, the multi-layer perceptron model can be updated through the return gradients.
[0021] The beneficial effects of the present invention are as follows: when a recommendation task requires federated learning training or reasoning, the service provider introduces a trusted third party through negotiation, and the service providers use the privacy set intersection technology through the trusted third party to intersect the user samples between the two parties to obtain a common user space for both parties, thereby ensuring the privacy and security of data transmission; based on the common user space, the present invention locally uses a multi-layer perceptron with a dynamic structure to calculate the intermediate result, the service provider encrypts the intermediate result, and obtains the calculation result and the return gradient through the interaction of ciphertext data, thereby realizing the data utilization of multiple service providers and improving the service recommendation effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] 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:
[0023] Figure 1 A flowchart of a service recommendation method based on vertical federated multi-layer perceptron and continuous learning;
[0024] Figure 2 This is a schematic diagram of the vertical federated learning algorithm framework;
[0025] Figure 3 Schematic diagram of the scaling and offset of the fully connected layer parameters of the model;
[0026] Figure 4 A schematic diagram of the process of cyclic screening of dynamic structures;
[0027] Figure 5 Code diagram for loop screening dynamic structure algorithm. DETAILED DESCRIPTION
[0028] 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.
[0029] refer to Figure 1-5 The present embodiment is described in detail, a service recommendation method based on a vertical federated multi-layer perceptron and continuous learning, specifically comprising the following steps:
[0030] S1. When a recommendation task requires federated learning training or reasoning, the service provider introduces a trusted third party through negotiation;
[0031] S2. The service providers use the privacy set intersection technology through a trusted third party to intersect the user samples between the two parties and obtain the common user space of both parties;
[0032] S3. Each service provider uses local data related to samples in a common user space as a data set, and uses a multi-layer perceptron with a dynamic structure to calculate intermediate results based on the common user space;
[0033] S4. The service provider encrypts the intermediate results and obtains the calculation results and the returned gradients through ciphertext data interaction;
[0034] S5. The encrypted data is transmitted back to the service provider, and the service provider obtains the actual calculation results and the transmitted gradient through masking technology;
[0035] Specifically, in order to protect the privacy of data, service provider A and service provider B plan to jointly train a multi-layer perceptron model for recommendation tasks through federated learning technology. Service provider A and service provider B both have user data, and there are many overlapping users between the two parties, that is, the common user space U = {u i|0 ≤ i < N}, where the service provider A locally has a dataset D composed of m feature fields of the above users A =[d i1 , d i2 , d i3 , …, d im |0 ≤ i < N}, and the service provider B locally has a dataset D composed of n feature fields of the above users B ={d i(m+1) , d i(m+2) , d i(m+3) , …, d i(m+n) |0 ≤ i < N}, and the feature fields they own do not overlap. And for the user u i ∈U, its related feature data d i1 , d i2 , …, d im , d i(m+1) , …, d i(m+n) can be used for training by a multi-layer perceptron in a centralized scenario;
[0036] In the above S1, the service provider A and the service provider B introduce a trusted third party through negotiation. Based on the federated learning industrial platform, the trusted third party can be implemented through a fixed program. The trusted third party can complete operations such as additive homomorphic encryption key generation, key transmission, and ciphertext decryption. When the trusted third party receives a new recommendation task t from the service provider A and the service provider B, it will generate a new set of additive homomorphic encryption keys (pk t , sk t ), where pk t is the public key and sk t is the private key, and it will transmit the public key pk t for encryption to the service provider A and the service provider B respectively. The trusted third party is mainly used to build the intersection in the private set intersection process;
[0037] In the above S2, the service provider A and the service provider B perform an intersection on the user samples between the two parties through the private set intersection technology, and judge whether they are common users of both parties through a unified user id field, and finally obtain the common user space U of both parties.
[0038] Furthermore, in the above S3, it includes the following steps:
[0039] S31. When the current calculation is for the training or inference of the first recommendation task, input the dataset into a conventional multi-layer perceptron to produce a pre-trained model and obtain the pre-trained model;
[0040] S32. When the current calculation is training or reasoning for a newly added recommendation task, the data set is put into a multi-layer perceptron with a dynamic structure, i.e., a pre-training model, the dynamic structure is cyclically screened, and an intermediate result is obtained based on the pre-training model training;
[0041] In the S32, the gradient of each parameter of the conventional multilayer perceptron after each round of training is accumulated during the cyclic screening of the dynamic structure. After a small number of iterations of samples in the data set, the parameter with the smallest absolute value in the partially accumulated gradient is recorded as a fixed structure parameter, and the fixed structure parameter is restored to the corresponding pre-trained model parameter, and does not participate in the gradient update in the subsequent training cycle iteration. The above operation is recorded as one screening, and then the remaining parameters that are not marked as fixed structure parameters are screened. After several screenings, the parameters participating in the gradient update are recorded as dynamic structure parameters;
[0042] After cyclically screening the dynamic structure, the dynamic structure model is obtained, the pre-trained model parameters are restored, and it is trained on the data set. Only the gradients related to the dynamic structure parameters are calculated and the dynamic structure parameters are updated. After several rounds of iterations, the training or reasoning of the newly added recommendation task is completed, and the intermediate results are obtained;
[0043] Specifically, in S3, user-related data in the common user space U is used as a data set, and an intermediate result is calculated locally using a multi-layer perceptron with a dynamic structure;
[0044] refer to Figure 5 , when in a loop screening dynamic structure, for this recommendation task t, the pre-trained model W pre That is, the pre-trained model parameter set is converted into a dynamic structure model W t That is, the dynamic structure model parameter set, a small amount of data is randomly extracted from the local data set D to form a data set d, and the pre-trained model gradient accumulation set G is zero-initialized. When the dynamic structure model parameter set W t Or the pre-trained model parameter set W pre The number is less than the upper limit S of the dynamic structure ratio parameter d When , reset the number of pre-trained model training iterations until it is less than the number of iterations of a single cycle screening, use the dataset d for training, and obtain the intermediate result r t ;
[0045] For service provider A, if the current recommended task t is the first recommended task t0, the first local data set D A Input the conventional multi-layer perceptron model W init Get the intermediate result r of service provider A t A, if the recommended task t is a newly added recommended task t i , i≠0, then the first data set D AInput it into a multi-layer perceptron with a dynamic structure. When not considering the dynamic structure, the multi-layer perceptron with a dynamic structure is the pre-trained model W obtained after the completion of the training of the first task t0. pre ;
[0046] Reference Figure 2 , when in the loop to screen the dynamic structure and then train based on the dynamic structure, it can be regarded as the calculation process of a conventional multi-layer perceptron with certain restricted conditions, that is, only part of the parameters are updated, and finally the intermediate result r is obtained. t A, if the current recommendation task t is a newly added recommendation task t i , i≠0, and the combination of cooperating service providers has changed, then in addition to completing the dynamic structure screening based on the multi-layer perceptron with a dynamic structure, in the calculation process of entering the pre-trained model training after screening, it is also necessary to scale and offset the high-level parameters on the existing model. That is, for the multi-layer perceptron model W with a total of k fully connected layers t = {w1, w2, …, w k-1 , w k}, for the parameters {w k-l+1 , w k-l+2 , …, w k-1 , w k} of each layer of the l-th layer of the high-level of the model, perform scaling and offset respectively {w' s = w s × sc s + sh s | k - l + 1 ≤ s ≤ k}, l < k, where, sc s is the scaling parameter, sh s is the offset parameter, regard the scaling parameter sc s and the offset parameter sh s as learning parameters, and at the same time regard the parameters {w k-l+1 , w k-l+2 , …, w k-1 , w k} of the l-th layer of the high-level of the model as non-learning parameters to further reduce parameter calculation and model parameter increment;
[0047] Service provider B performs dynamic structure loop screening and dynamic structure model training locally, and according to the change of the current recommendation task and the combination of service providers, performs scaling and offset of the high-level parameters of the multi-layer perceptron model to obtain the intermediate result r t B of service provider B. The local models, scaling parameters and offset parameters of service provider A and service provider B are respectively initialized and determined locally by themselves.
[0048] Furthermore, in S4, the trusted third party generates an encrypted ciphertext that satisfies additive homomorphism and transmits it to the service provider. The high-level parameters of the multi-layer perceptron model of the service provider are scaled and offset according to the layers based on different service provider combinations, and the calculation result of the ciphertext is obtained by interacting with the ciphertext data in combination with the encrypted intermediate result. If the above calculation process is required for task training, the return gradient under the ciphertext is obtained;
[0049] The scaling and offsetting of high-level parameters of the multilayer perceptron model of the service provider is performed, that is, for the fully connected layer closest to the output of the multilayer perceptron model, all weight parameters in the layer are scaled and offset in the same manner, and the coefficients of the scaling and offset changes are used as learnable parameters, while the original weight parameters of the multilayer perceptron model are not used as updateable parameters;
[0050] Specifically, service provider A and service provider B use public keys pk t The intermediate result r of encryption service provider A t The intermediate result r between A and service provider B t B, obtains the encrypted intermediate result of service provider A [[r t A]] and the encrypted intermediate result of service provider B [[r t B]], the calculation results in the encrypted state calculated by the longitudinal federated linear regression algorithm in the encrypted state loss [[loss]], a back-transmitted gradient [[g]], wherein the back-transmitted gradient [[g]] includes a first back-transmitted gradient [[gA]] and a second back-transmitted gradient [[gB]], which are respectively transmitted back to service provider A and service provider B;
[0051] refer to Figure 5 , through the encrypted interaction of intermediate results, the training gradient g is obtained, the parameter with the smallest absolute value in the partially accumulated gradient G is recorded as the fixed structure parameter, and the fixed structure parameter is restored to the corresponding pre-trained model parameter.
[0052] In S5, after receiving the ciphertext, the service provider obtains the masked calculation result and the returned gradient from the trusted third party through the masking technology, and obtains the actual calculation result and the returned gradient after removing the mask locally. If the above calculation process is required for task training, the multi-layer perceptron model, i.e., the local model, can be updated through the returned gradient;
[0053] Specifically, service provider A obtains the masked first gradient original gA and other originals from a trusted third party by adding a mask. Service provider A generates a random number randn locally and uses the public key pk tEncrypt it to obtain the encrypted locally generated random number [[randn]], then add the encrypted first return gradient [[gA]] and the encrypted locally generated random number [[randn]] to obtain the ciphertext [[gA+randn]], and pass the above ciphertext to the trusted third party. The third party decrypts and obtains the first gradient original text gA and the locally generated random number randn without the mask and returns them. In this way, service provider A can obtain the entire gradient original text by subtracting the locally generated random number randn, while the trusted third party cannot obtain the real return gradient;
[0054] After obtaining the gradient, when in the first recommendation task t0 training, the back-transmitted gradient and the multi-layer perceptron model are updated by conventional methods; when in the step of loop screening dynamic structure, the gradient can be accumulated, and after a certain number of cycles, some parameters with the smallest L1 paradigm can be excluded from the dynamic structure according to a certain ratio based on the accumulated gradient;
[0055] refer to Figure 5 After obtaining the training gradient g for each training round, the training gradient is accumulated, and several gradients g with the smallest absolute value in the accumulated gradient G are screened to obtain their gradients in the dynamic structure model W. t The corresponding parameter set W in tf , so that it satisfies the parameter set W tf The ratio of the number of to the number of pre-trained model parameter sets is equal to the single-cycle screening ratio s f , in the dynamic structure model parameter set W t Remove the filtered parameter set W tf , update the dynamic structure model and reduce the number of model parameters, and end the training;
[0056] When training based on a dynamic structure model, the gradients of the parameters contained in the dynamic structure are updated by conventional methods;
[0057] Similarly, service provider B obtains the second gradient text gB by adding a mask, and the gradient text will not be leaked to a third party. In the model parameter update phase, service provider B uses the second gradient text gB locally to update the local model parameters, accumulates gradients in the cyclic screening dynamic structure phase, and updates the dynamic structure after a certain number of rounds. The local model parameter update steps, dynamic structure screening steps, and dynamic structure update steps of service provider A and service provider B are all completed locally, and the two parties do not affect each other.
[0058] 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 service recommendation method based on vertical federated multi-layer perceptron and continuous learning, 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 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; 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; 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, 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.
2. A service recommendation method based on vertical federated multi-layer perceptron and continuous learning according to claim 1, characterized in that: The S3 comprises the following steps: S31. When the current calculation is the training or reasoning of the first recommendation task, the data set is put into a conventional multi-layer perceptron to produce a pre-trained model to obtain a pre-trained model; S32. When the current calculation is training or reasoning for a newly added recommendation task, the data set is put into a multi-layer perceptron with a dynamic structure, i.e., a pre-training model, the dynamic structure is cyclically screened, and an intermediate result is obtained based on the pre-training model training; In the S32, the gradient of each parameter of the conventional multilayer perceptron after each round of training is accumulated during the cyclic screening of the dynamic structure. After a small number of iterations of samples in the data set, the parameter with the smallest absolute value in the partially accumulated gradient is recorded as a fixed structure parameter, and the fixed structure parameter is restored to the corresponding pre-trained model parameter, and does not participate in the gradient update in the subsequent training cycle iteration. The above operation is recorded as one screening, and then the remaining parameters that are not marked as fixed structure parameters are screened. After several screenings, the parameters participating in the gradient update are recorded as dynamic structure parameters; After cyclically screening the dynamic structure, the dynamic structure model is obtained, the pre-trained model parameters are restored, and it is trained on the data set. Only the gradients related to the dynamic structure parameters are calculated and the dynamic structure parameters are updated. After several rounds of iterations, the training or inference of the newly added recommendation task is completed and the intermediate results are obtained.
3. The service recommendation method based on vertical federated multi-layer perceptron and continuous learning according to claim 2 is 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 high-level parameters of the multi-layer perceptron model of the service provider are scaled and offset according to the layer based on different service provider combinations, and the calculation result of the ciphertext is obtained by combining the encrypted intermediate result through the ciphertext data interaction. If the above calculation process is required for task training, the return gradient under the ciphertext is obtained; The high-level parameters of the multilayer perceptron model of the service provider are scaled and offset, that is, for the fully connected layer closest to the output of the multilayer perceptron model, all weight parameters in it are uniformly scaled and offset according to the layer, and the coefficients of the scaling and offset changes are used as learnable parameters, while the original weight parameters of the multilayer perceptron model are not used as updateable parameters.
4. The service recommendation method based on vertical federated multi-layer perceptron and continuous learning according to claim 3 is characterized in that: In S5, after receiving the ciphertext, the service provider obtains the masked calculation results and return gradients from the trusted third party through masking technology, and obtains the actual calculation results and return gradients after removing the masks locally. If the above calculation process is required for task training, the multi-layer perceptron model can be updated through the return gradients.
