Federal collaborative filtering recommendation method fusing semi-homomorphic encryption

By adopting Paillier semi-homomorphic encryption technology and implicit feedback non-sampling matrix decomposition model in the recommendation system, combined with ALS and SGD optimization, the problem of gradient information leakage in traditional recommendation systems is solved, and efficient privacy protection and recommendation performance is achieved. promote.

CN119106200APending Publication Date: 2024-12-10LIAONING UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411158301.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Traditional recommendation systems have flaws in user privacy protection, especially when gradient information is uploaded, user privacy may be leaked. Existing privacy protection technologies such as anonymization and differential privacy technologies are difficult to completely solve this problem.

Method used

Using a federated learning framework based on Paillier semi-homomorphic encryption, integrating semi-homomorphic encryption technology, the user and project factor matrix is ​​optimized using ALS and SGD, and the gradient is used in the federated learning framework. Encoding is performed to ensure the security of data transmission.

Benefits of technology

Effectively prevent gradients from leaking user privacy, enhance privacy protection, improve recommendation performance, and ensure the security of user data without losing recommendation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106200A_ABST
    Figure CN119106200A_ABST
Patent Text Reader

Abstract

The invention discloses a federated collaborative filtering recommendation method fused with semi-homomorphic encryption. The method comprises the following steps: constructing a non-sampling matrix decomposition model based on implicit feedback; the user factor matrix is solved through ALS optimization; sGD optimization is adopted to solve a project factor matrix; establishing a universal federated learning framework, locally storing weight parameters by a user, and training a non-sampling matrix decomposition model by using implicit feedback data; the Paillier semi-homomorphic encryption is fused into a federated learning framework, and the gradient is coded; and the security and recommendation performance of the FedNSMF method are analyzed. According to the federated collaborative filtering recommendation method fused with semi-homomorphic encryption, the problem of gradient leakage of user privacy in federated collaborative filtering recommendation is solved based on a general federated framework of Paillier semi-homomorphic encryption, privacy protection is enhanced with relatively high recommendation efficiency, and recommendation performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of federated learning technology, and in particular to a federated collaborative filtering recommendation method integrating semi-homomorphic encryption. Background Art

[0002] In the information age, a large amount of data has caused people to face the problem of information overload. The introduction of recommendation systems has alleviated this problem. Recommendation systems are used in various business scenarios and can be seen everywhere in people's daily Internet life. As people's awareness of privacy protection increases, the privacy security of user data has become increasingly important, and privacy protection in recommendation systems has become important. Traditional recommendation algorithms often need to collect users' original data and upload it to the server, train a global model, and then make recommendations, but this approach often leads to the problem of user privacy leakage.

[0003] Based on this, a variety of privacy protection technologies have been proposed and applied in recommendation systems. Among them, anonymization is the simplest and most direct privacy protection method, which can prevent the server or attacker from knowing the source user of the information, but the information itself still has the risk of leakage. Differential privacy technology is based on rigorous mathematical principles and has strong privacy protection capabilities, but it will lose data availability. Federated learning avoids the leakage of user data on the server side through distributed learning. Although it is still possible to be attacked when uploading gradient information, it can be solved through encryption algorithms.

[0004] Therefore, in response to the problems in the prior art, the present invention adopts a federated learning framework based on Paillier semi-homomorphic encryption and provides a federated collaborative filtering recommendation method integrating semi-homomorphic encryption. Summary of the invention

[0005] The purpose of the present invention is to provide a federated collaborative filtering recommendation method integrating semi-homomorphic encryption. Based on a general federated framework of Paillier semi-homomorphic encryption, the problem of gradient leakage of user privacy in federated collaborative filtering recommendation is solved, privacy protection is enhanced with higher recommendation efficiency, and recommendation performance is improved.

[0006] To achieve the above object, the present invention provides a federated collaborative filtering recommendation method integrating semi-homomorphic encryption, comprising the following steps:

[0007] S1. Construct a non-sampled matrix factorization model based on implicit feedback;

[0008] S2, using ALS optimization to solve the user factor matrix;

[0009] S3, using SGD optimization to solve the project factor matrix;

[0010] S4. Establish a general federated learning framework, where users save weight parameters locally and use implicit feedback data to train the unsampled matrix factorization model;

[0011] S5. Integrate Paillier semi-homomorphic encryption into the federated learning framework to encode gradients.

[0012] S6. Analyze the security and recommended performance of the FedNSMF method.

[0013] Preferably, in step S1, constructing a non-sampling matrix decomposition model based on implicit feedback includes the following steps:

[0014] S11. In matrix decomposition, each entry r ui The estimate of ∈R is as follows:

[0015]

[0016] Where R∈{0,1} n×m is the user-item interaction matrix, represents the user-specific latent feature vector for user u, represents the item-specific latent feature vector for item i;

[0017] S12. Adopt the NSMF general loss function with implicit feedback to separate the weight parameters related to user privacy, as shown below:

[0018]

[0019] Where u represents the user, i represents the item, R = {(u,i)} is the observed (u,i) pair; U represents the entire user set, I represents the entire item set, ω ui is the weight of the observed (u,i) pair; λ is the regularization parameter, α u is the user-oriented weight of user u in the missing data, β i is the item-oriented weight for item i in the missing data.

[0020] Preferably, in the NSMF model, the following strategy is used to assign appropriate weights to missing data:

[0021] (1) Zero weight strategy for missing items: Set the weight of the missing items to 0, i.e., r ui =0,α u =0 or β i =0;

[0022] (2) Unified weight strategy for all entries: Apply a uniform weight of 1 to all data entries, i.e., ω ui =α u =βi =1;

[0023] (3) Uniform weight strategy for missing entries: assign the same weight to all missing entries, that is, if r ui =0 then α u =1,β i =β0;

[0024] (4) Frequency weight strategy based on missing items: assign non-uniform weights to missing items; the weights depend on the popularity of the items or user activity, that is, assign non-uniform weights α based on user activity. u , or assign non-uniform weights β based on item popularity i .

[0025] Preferably, in step S2, ALS optimization is used to solve the user factor matrix, and the specific process is as follows:

[0026] S21. For each user u, there is a gradient U u· , as shown below:

[0027]

[0028] Among them, I u Represents the items that user u interacts with;

[0029] S22. Order The update rule for each user u based on ALS is as follows:

[0030]

[0031] Where D is a d×d identity matrix; The calculation of is very time-consuming and requires traversing all missing data;

[0032] S23, using a caching strategy in NSMF to optimize computational complexity, rewriting As shown below:

[0033]

[0034] S24. Substitute formula (5) into formula (4), as shown below:

[0035]

[0036] Among them, S V =∑ i∈I β i V i· T V i· ; Cache S VIt is independent of u and can be calculated by pre-calculating S V To speed up the calculation of latent factors for all users.

[0037] Preferably, in step S3, SGD optimization is used to solve the project factor matrix, and the specific process is as follows:

[0038] S31. For each item i, there is a gradient V i· , as shown below:

[0039]

[0040] Among them, cache S U Regardless of i, by pre-calculating S U To speed up the calculation of latent factors for all items;

[0041] S32, SGD-based V i· Update the rules as follows:

[0042]

[0043] S33, when using the gradient descent method to update V i· In the Adam method, the gradient descent is performed in two independent parts, recording the past gradient m t and squared gradient v t The exponentially decaying average of is as follows:

[0044]

[0045]

[0046] Among them, set 0<μ1,μ2<1, usually the values ​​of m and v are initialized to 0;

[0047] S34. In order to offset the deviation, m and v are corrected. The corrected versions of m and v are as follows:

[0048]

[0049]

[0050] S35, V i· The update rules are as follows:

[0051]

[0052] Here, 0<γ<1.0 is a constant learning rate, and 0<ε<<1.

[0053] Preferably, in step S4, the federated non-sampling matrix decomposition method decomposes the model parameter iterative update process into two parts, which are executed on the client and the server respectively;

[0054] The server continuously provides the latest project profile matrix V for all users to download; each user u has the latest downloaded V and its own weight parameters, and then performs local updates and calculates the gradient Gradient i , and then the gradient i Sent back to the server to update the project configuration file V.

[0055] Preferably, in step S5, Paillier semi-homomorphic encryption is integrated into the federated learning framework so that it encodes the gradient. The specific process is as follows:

[0056] First, in the key generation phase, the functions involved in semi-homomorphic encryption are used to generate public and private keys. The key generation process is only performed on one of the users, and all participants, including the server, know the public key, while the private key is only shared between users and is not protected by the server. After the key is generated, different TLS / SSL secure channels are established to send the public and private keys to the corresponding participants.

[0057] Then, before starting the matrix decomposition process, the parameters are initialized; the project configuration file is initialized on the server, and the user configuration file is initialized by each user on the local client;

[0058] Finally, matrix decomposition is performed.

[0059] Preferably, matrix decomposition comprises the following steps:

[0060] A. The server uses the public key to encrypt the project configuration file V and obtains the ciphertext C v ; From this point on, the server is ready with the latest C v Available for download by all users;

[0061] B. Each user downloads the latest C from the server v , and use the private key to decrypt to get the plaintext V; use V to perform local updates and calculate the user profile U and gradient G; encrypt G with the public key to get the ciphertext C G ; Finally, a TLS / SSL secure channel is established to G Sent to the server through this secure channel;

[0062] C. The server receives the user's encrypted gradient C G Finally, update the project configuration file with the ciphertext: Then, the server updates the latest C vAvailable for download by all users;

[0063] D. Iterate steps B and C until a certain number of iterations is reached.

[0064] Therefore, the present invention adopts the above-mentioned federated collaborative filtering recommendation method integrating semi-homomorphic encryption, and solves the problem of gradient leakage of user privacy in federated collaborative filtering recommendation based on the general federated framework of Paillier semi-homomorphic encryption, enhances privacy protection with higher recommendation efficiency, and improves recommendation performance.

[0065] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 It is the training process of federated unsampled matrix factorization;

[0067] Figure 2 It is a federated framework based on Paillier semi-homomorphic encryption;

[0068] Figure 3 is the influence of the potential dimension in the embodiment of the present invention; wherein (a) is the influence of the potential dimension of the accuracy assessment; (b) is the influence of the potential dimension of the normalized discounted cumulative return assessment;

[0069] Figure 4 1 is a comparison chart of convergence in the embodiment of the present invention; wherein (a) is the convergence performance of the accuracy evaluation algorithm; (b) is the convergence performance of the normalized discounted cumulative return evaluation algorithm;

[0070] Figure 5 It is a flow chart of a federated collaborative filtering recommendation method integrating semi-homomorphic encryption according to the present invention. DETAILED DESCRIPTION

[0071] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.

[0072] like Figure 5 As shown, the present invention provides a federated collaborative filtering recommendation method integrating semi-homomorphic encryption, comprising the following steps:

[0073] S1. Construct a non-sampled matrix factorization model based on implicit feedback.

[0074] S11. In matrix decomposition, each entry r ui The estimate of ∈R is as follows:

[0075]

[0076] Where R∈{0,1} n×m is the user-item interaction matrix, represents the user-specific latent feature vector for user u, Represents the item-specific latent feature vector for item i.

[0077] S12. Adopt the NSMF general loss function with implicit feedback to separate the weight parameters related to user privacy, as shown below:

[0078]

[0079] Where u represents the user, i represents the item, R = {(u,i)} is the observed (u,i) pair; U represents the entire user set, I represents the entire item set, ω ui is the weight of the observed (u,i) pair; λ is the regularization parameter, α u is the user-oriented weight of user u in the missing data, β i is the item-oriented weight for item i in the missing data.

[0080] S13. In implicit feedback modeling, r ui = 1 for observed entries, r ui = 0 indicates missing entries. In the NSMF model, the following strategy is used to assign appropriate weights to missing data:

[0081] (1) Zero weight strategy for missing items: Set the weight of the missing items to 0, i.e., r ui =0,α u =0 or β i = 0. This is a commonly used setting in rating prediction recommendation, which aims to predict the values ​​of missing items in the user-item rating matrix. However, it may perform poorly in Top-N recommendation.

[0082] (2) Unified weight strategy for all entries: Apply a uniform weight of 1 to all data entries, i.e., ω ui =α u =β i = 1. This setting may produce good performance when the missing data is of the same size as the observed data. However, in the real world, the missing data is often larger than the observed data, so for this highly imbalanced learning scenario, this strategy will cause the learning process to be dominated by the missing data.

[0083] (3) Uniform weight strategy for missing entries: assign the same weight to all missing entries. If r ui =0 then α u =1,β i =β0. Studies have shown that this strategy can produce better performance than the unified weight strategy for all items in the recommendation task and has been widely used.

[0084] (4) Frequency weight strategy based on missing items: assign non-uniform weights to missing items, and the weights depend on the popularity of the items or user activities, that is, assign non-uniform weights α based on user activities u , or assign non-uniform weights β based on item popularity i The uniform weighting strategy assumes that all missing entries provide the same level of negative signal, which severely limits the fidelity of modeling real-world scenarios.

[0085] S2. Use ALS optimization to solve the user factor matrix.

[0086] S21. For each user u, there is a gradient U u· , as shown below:

[0087]

[0088] Among them, I u Represents the items that user u interacts with.

[0089] S22. Order The update rule for each user u based on ALS is as follows:

[0090]

[0091] Where D is a d×d identity matrix; The calculation of is very time-consuming and requires traversing all missing data.

[0092] S23. Therefore, a cache strategy is used in NSMF to optimize the computational complexity and rewrite As shown below:

[0093]

[0094] S24. Substitute formula (5) into formula (4), as shown below:

[0095]

[0096] Among them, S V =∑ i∈I β i V i· T V i· ; Cache S V It is independent of u and can be calculated by pre-calculating S V To speed up the calculation of latent factors for all users.

[0097] S3. Use SGD optimization to solve the project factor matrix.

[0098] S31. For each item i, there is a gradient V i· , as shown below:

[0099]

[0100] Among them, cache S U Regardless of i, by pre-calculating S U To speed up the calculation of latent factors for all items.

[0101] S32, SGD-based V i· Update the rules as follows:

[0102]

[0103] S33, when using the gradient descent method to update V i· When V i· In the Adam method, gradient descent is performed in two independent parts, recording the past gradient m t and squared gradient v t The exponentially decaying average of is as follows:

[0104]

[0105]

[0106] Here, 0<μ1,μ2<1 is set. Usually, the values ​​of m and v are initialized to 0 and thus tend to be 0.

[0107] S34. In order to offset these deviations, m and v are corrected. The corrected versions of m and v are as follows:

[0108]

[0109]

[0110] S35, V i· The update rules are as follows:

[0111]

[0112] Among them, 0<γ<1.0 is a constant learning rate, and 0<ε<<1 to avoid division by zero.

[0113] S4. Establish a general federated learning framework, where users save weight parameters locally and use implicit feedback data to train the unsampled matrix factorization model.

[0114] In the unsampled matrix factorization scenario of federated learning, users save weight parameters locally and use implicit feedback data to train the model. The federated unsampled matrix factorization method decomposes the iterative update process of model parameters into two parts, which are executed on the client and server respectively. That is, the user local update refers to the update performed on the local client of user u; the server update refers to the update performed on the server, that is, the update of the project profile. This decomposition prevents the server from directly understanding the user's original preference data or the learned profile.

[0115] The non-sampling matrix decomposition algorithm based on federated learning is shown in Table 1. The training process of the federated non-sampling matrix decomposition is as follows: Figure 1 As shown. The server continuously provides the latest project profile matrix V for all users to download. Each user u has the latest downloaded V and its own weight parameters, and then performs local updates and calculates the gradient Gradient i , and then the gradient i Sent back to the server to update the project configuration file V.

[0116] Table 1 Non-sampling matrix factorization algorithm based on federated learning

[0117]

[0118]

[0119] S5. Integrate Paillier semi-homomorphic encryption into the federated learning framework to encode gradients.

[0120] In order to solve the problem of gradients leaking user privacy, semi-homomorphic encryption is used to encode the gradients, so that the server cannot reverse the encoding process. The encoded data will not leak any information, and the server can still perform updates based on the encoded gradients.

[0121] The federated framework based on Paillier semi-homomorphic encryption (FedNSMF), such as Figure 2 As shown in Figure 2, there are two types of participants involved in this framework, namely, servers and users. Assuming that the server is honest but curious and the user is honest, the user's privacy cannot be protected on the server.

[0122] First, in the key generation phase, the functions involved in semi-homomorphic encryption are used to generate public and private keys, where the key generation process is only performed on one of the users. At the same time, all participants, including the server, know the public key. The private key is only shared between users and needs to be protected from the server. After the key is generated, different TLS / SSL secure channels are established to send the public and private keys to the corresponding participants.

[0123] Then, before starting the matrix factorization process, parameter initialization is performed. The project configuration file is initialized on the server, while the user configuration file is initialized by each user on the local client.

[0124] Finally, matrix decomposition is performed. The specific process is as follows:

[0125] A. The server uses the public key to encrypt the project configuration file V and obtains the ciphertext C v From this moment on, the server is ready with the latest C v Available for download to all users.

[0126] B. Each user downloads the latest C from the server v , and decrypt it with the private key to get the plaintext V. Next, use V to perform local updates and calculate the user profile U and the gradient G. After that, encrypt G with the public key to get the ciphertext C G Finally, a TLS / SSL secure channel is established to connect C G Sent to the server through this secure channel.

[0127] C. The server receives the user's encrypted gradient C G Finally, update the project configuration file with this ciphertext: After that, the server updates the latest C v Available for download to all users.

[0128] D. Iterate steps B and C until a certain number of iterations is reached.

[0129] S6. Analyze the security and recommended performance of the FedNSMF method.

[0130] 1) Security analysis. In this framework, users only send ciphertext to the server, and the data involved in the calculation and update in the server are all ciphertext. At the same time, the project configuration files downloaded by users from the server are also encrypted. Therefore, the data transmitted in the entire framework are encrypted data, and the calculations involving plaintext are only performed on the local client. All data except the initialized project configuration files are also completely confidential to the server, preventing gradients from leaking user privacy, thereby ensuring the privacy security of users. Therefore, as long as the homomorphic encryption system can ensure that the ciphertext is not recognized by the selected plaintext attack, no information will be leaked to the server.

[0131] 2) Recommendation performance analysis. If the homomorphic encryption part is removed, the parameter update process of the FedNSMF method is the same as the federated non-sampling matrix factorization process. In addition, since this method does not confuse the data, it is lossless, thus ensuring the accuracy of the recommendation.

[0132] Example

[0133] 1. Experimental dataset and evaluation indicators.

[0134] This example uses the real dataset MovieLens 1M (ML1M) from http: / / files.grouplens.org / datasets / movielens / , and constructs three training sets and test sets based on it. The experimental results of recommendation accuracy are the average performance of the three test data. In addition, the potential dimension, convergence and time cost are experimentally verified on the first training set and test set.

[0135] The experimental environment is: Intel(R) Core(TM) i5-7200U CPU 2.50GHz processor, 8.00GB memory, Windows 10 operating system, and Python language is used for simulation experiments.

[0136] In the federated single-class collaborative filtering recommendation system, the model will provide a Top-N ranked list of items for each user as a recommendation list. In order to evaluate the recommendation list of each user's preferred item set in the test data, precision (Prec) and normalized discounted cumulative gain (NDCG) are used as evaluation indicators, which are usually used for ranking-oriented evaluation. Prec@5 and NDCG@5 are used to evaluate the top 5 items in the ranked list.

[0137] 2. Baseline and parameter settings.

[0138] In order to evaluate the accuracy and efficiency of the FedNSMF method proposed in this paper, this method is compared with the following methods:

[0139] 1. WMF: This is a representative method based on the unsampled matrix factorization model. It regards all missing interactions as negative examples and assigns them uniform weights. According to the FCF method, WMF is selected as the backbone method and the FedNSMF method is implemented based on it.

[0140] 2. FCF: This is an early federated collaborative filtering framework for project ranking recommendation with implicit feedback. It is also a method based on a non-sampling matrix factorization model, which optimizes user-specific latent feature vectors through ALS and then optimizes project-specific latent feature vectors through SGD.

[0141] 3. P-NSMF: Here we choose the P-NSMF method based on BGD optimization as the method for comparative experiments. It optimizes the user-specific latent feature vector and the item-specific latent feature vector through BGD.

[0142] 4. FedNSMF(NP): The federated non-sampling matrix factorization method proposed in this method does not include semi-homomorphic encryption.

[0143] The detailed configuration of the parameters are as follows:

[0144] (1) The number of iterations is fixed at T = 500 to ensure that all models converge to the optimal solution.

[0145] (2) WMF applies uniform weights to missing data, so ω is set for all models ui =ω0 and α u =β i = 1. Following the FCF, WMF is used to select two common hyperparameters for all models (i.e., the observation data weight ω0 and the regularization parameter λ). Specifically, following the FCF, the best weight value for the data is obtained from ω0∈{2,3,4,5,6}, i.e., ω0=4. In addition, the best value of the regularization parameter is found from λ∈{0,0.1,0.01,0.001}, i.e., λ=0.01.

[0146] (3) For FedNSMF and P-NSMF, find the optimal value of the learning rate γ from {2.6, 2.8, ..., 3.6}, i.e., γ = 3.0.

[0147] (4) For FCF, find the optimal value of the learning rate γ from {2.0, 2.2, ..., 3.0}, that is, γ = 2.4.

[0148] During the experiment, multiprocessing programming in Python was used to simulate the federated learning system, where each client and server was implemented as a process.

[0149] 3. Recommended performance experimental results and analysis.

[0150] The latent dimension d refers to the number of dimensions used to represent the implicit features of users and items in the matrix decomposition model, which has an important impact on the recommendation performance. In order to find the optimal latent dimension d, a comparative experiment was conducted by setting different d values ​​(i.e., d∈{20,40,60,80,100}) in WMF, FCF, P-NSMF, FedNSMF (NP), and FedNSMF. The experimental results are shown in Figure 2. Figure 3 shown.

[0151] from Figure 3It can be seen that with the increase of the potential dimension d, the recommendation accuracy and normalized discounted cumulative return value of WMF, FCF, P-NSMF, FedNSMF (NP) and FedNSMF show a downward trend. When the potential dimension d = 20, the recommendation accuracy and normalized discounted cumulative return value of FedNSMF are the best. When the potential dimension value d is too large, the model may be too complex, resulting in overfitting. In subsequent experiments, the potential dimension d value is selected to be equal to 20.

[0152] In order to verify the recommendation performance of the FedNSMF algorithm, experiments were conducted on three datasets using FedNSMF, FedNSMF(NP), P-NSMF, WMF and FCF algorithms, and the average values ​​of Prec@5 and NDCG@5 were taken.

[0153] As shown in Table 2, FedNSMF can achieve the same recommendation performance as the non-privacy FedNSMF (NP), which shows that FedNSMF can protect users’ privacy without sacrificing any recommendation performance. FedNSMF slightly outperforms P-NSMF (BGD), WMF (ALS), and FCF (ALS, SGD) in most cases, which shows that SGD may be a better optimizer than BGD and ALS when learning the NSMF model.

[0154] Table 2 Experimental results of recommended performance

[0155]

[0156]

[0157] 4. Convergence performance experimental results and analysis.

[0158] In order to verify the speed and stability of FedNSMF in converging to the optimal solution during training, the convergence of FedNSMF, P-NSMF and WMF is compared.

[0159] from Figure 4 It can be seen that the convergence curve of FedNSMF is similar to that of FCF, which shows that semi-homomorphic encryption technology has no significant impact on the convergence of the basic model. It can also be seen that due to the different optimization methods, the convergence speed of FedNSMF is much faster than that of P-NSMF. For example, the Prec@5 of FedNSMF reaches 0.469 within 100 iterations, while P-NSMF needs 470 iterations to reach a similar convergence value.

[0160] 5. Time expenditure experimental results and analysis.

[0161] In order to verify the recommendation efficiency of FedNSMF, the time spent by FedNSMF, P-NSMF, FCF and WMF is compared, as shown in Table 3. It can be seen that in the case of 500 iterations, the time spent by FedNSMF and P-NSMF is relatively small.

[0162] Table 3 Comparison of time expenditure

[0163] method WMF FCF P-NSMF FedNSMF Time(s) 35445.23 40467.93 25314.76 25576.88

[0164] Therefore, the present invention adopts the above-mentioned federated collaborative filtering recommendation method integrating semi-homomorphic encryption, and the general federated framework based on Paillier semi-homomorphic encryption is used to solve the problem of gradient leakage of user privacy in federated collaborative filtering recommendation. First, based on the non-sampling matrix decomposition model based on implicit feedback, ALS and SGD are used to optimize the NSMF loss function, and the user factor matrix is ​​solved by ALS optimization, and the project factor matrix is ​​solved by SGD optimization. Secondly, a federated learning framework based on non-sampling matrix decomposition is proposed, and the original behavior data of the user is saved to the user's local device. The user only needs to upload the gradient to participate in the training of the global model to achieve privacy protection. Then, in view of the problem of gradient leakage of user privacy, Paillier semi-homomorphic encryption is integrated into the federated learning framework to ensure that the data transmitted in the entire framework are encrypted data, and the calculations involving plaintext are only performed on the local client. Finally, experiments are designed to verify the recommendation performance, convergence performance and time cost of the algorithm, and the experimental results are analyzed. The experimental results show that this method can enhance privacy protection and improve recommendation performance with higher recommendation efficiency.

[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.

Claims

1. A federated collaborative filtering recommendation method integrating semi-homomorphic encryption, characterized in that: The following steps are involved: S1. Construct a non-sampled matrix factorization model based on implicit feedback; S2, using ALS optimization to solve the user factor matrix; S3, using SGD optimization to solve the project factor matrix; S4. Establish a general federated learning framework, where users save weight parameters locally and use implicit feedback data to train the unsampled matrix factorization model; S5. Integrate Paillier semi-homomorphic encryption into the federated learning framework to encode gradients. S6. Analyze the security and recommended performance of the FedNSMF method.

2. According to the method of claim 1, the federated collaborative filtering recommendation method integrating semi-homomorphic encryption is characterized in that: In step S1, a non-sampling matrix factorization model based on implicit feedback is constructed, including the following steps: S11. In matrix decomposition, each entry r ui The estimate of ∈R is as follows: Where R∈{0,1} n×m is the user-item interaction matrix, represents the user-specific latent feature vector for user u, represents the item-specific latent feature vector for item i; S12. Adopt the NSMF general loss function with implicit feedback to separate the weight parameters related to user privacy, as shown below: Where u represents the user, i represents the item, R = {(u,i)} is the observed (u,i) pair; U represents the entire user set, I represents the entire item set, ω ui is the weight of the observed (u,i) pair; λ is the regularization parameter, α u is the user-oriented weight of user u in the missing data, β i is the item-oriented weight for item i in the missing data.

3. According to the method of claim 2, the federated collaborative filtering recommendation method integrating semi-homomorphic encryption is characterized in that: In the NSMF model, the following strategy is used to assign appropriate weights to missing data: (1) Zero weight strategy for missing items: Set the weight of the missing items to 0, i.e., r ui =0,α u =0 or β i =0; (2) Unified weight strategy for all entries: Apply a uniform weight of 1 to all data entries, that is, ω ui =α u =β i =1; (3) Uniform weight strategy for missing entries: assign the same weight to all missing entries, that is, if r ui =0 then α u =1,β i =β0; (4) Frequency weight strategy based on missing items: assign non-uniform weights to missing items; the weights depend on the popularity of the items or user activity, that is, assign non-uniform weights α based on user activity. u , or assign non-uniform weights β based on item popularity i .

4. According to the method of claim 1, the federated collaborative filtering recommendation method integrating semi-homomorphic encryption is characterized in that: In step S2, ALS optimization is used to solve the user factor matrix. The specific process is as follows: S21. For each user u, there is a gradient U u· , as shown below: Among them, I u represents the item interacting with user u, and m represents the number of users; S22. Order The update rule for each user u based on ALS is as follows: Where D is a d×d identity matrix; The calculation of is very time-consuming and requires traversing all missing data; S23, using a caching strategy in NSMF to optimize computational complexity, rewriting As shown below: S24. Substitute formula (5) into formula (4), as shown below: in, Cache S V It is independent of u and can be calculated by pre-calculating S V To speed up the calculation of latent factors for all users.

5. According to claim 1, a federated collaborative filtering recommendation method integrating semi-homomorphic encryption is characterized in that: In step S3, SGD optimization is used to solve the project factor matrix. The specific process is as follows: S31. For each item i, there is a gradient V i· , as shown below: Among them, cache S U Regardless of i, by pre-calculating S U To speed up the calculation of latent factors for all items; S32, SGD-based V i· Update the rules as follows: S33, when using the gradient descent method to update V i· In the Adam method, the gradient descent is performed in two independent parts, recording the past gradient m t and squared gradient v t The exponentially decaying average of is as follows: Among them, set 0<μ1,μ2<1, usually the values ​​of m and v are initialized to 0; S34. In order to offset the deviation, m and v are corrected. The corrected versions of m and v are as follows: S35, V i· The update rules are as follows: Here, 0<γ<1.0 is a constant learning rate, and 0<ε<<1.

6. According to claim 1, a federated collaborative filtering recommendation method integrating semi-homomorphic encryption is characterized in that: In step S4, the federated non-sampling matrix factorization method decomposes the iterative update process of model parameters into two parts, which are executed on the client and server respectively; The server continuously provides the latest project profile matrix V for all users to download; each user u has the latest downloaded V and its own weight parameters, and then performs local updates and calculates the gradient Gradient i , and then the gradient i Sent back to the server to update the project configuration file V.

7. The method for federated collaborative filtering recommendation integrating semi-homomorphic encryption according to claim 1 is characterized in that: In step S5, Paillier semi-homomorphic encryption is integrated into the federated learning framework to encode the gradient. The specific process is as follows: First, in the key generation phase, the functions involved in semi-homomorphic encryption are used to generate public and private keys. The key generation process is only performed on one of the users, and all participants, including the server, know the public key, while the private key is only shared between users and is not protected by the server. After the key is generated, different TLS / SSL secure channels are established to send the public and private keys to the corresponding participants. Then, before starting the matrix decomposition process, the parameters are initialized; the project configuration file is initialized on the server, and the user configuration file is initialized by each user on the local client; Finally, matrix decomposition is performed.

8. The method for federated collaborative filtering recommendation integrating semi-homomorphic encryption according to claim 7 is characterized in that: Matrix decomposition, including the following steps: A. The server uses the public key to encrypt the project configuration file V and obtain the ciphertext C v ; From this point on, the server is ready with the latest C v Downloadable for all users; B. Each user downloads the latest C from the server v , and use the private key to decrypt to get the plaintext V; use V to perform local updates and calculate the user profile U and gradient G; encrypt G with the public key to get the ciphertext C G ; Finally, a TLS / SSL secure channel is established to G Sent to the server through this secure channel; C. The server receives the user's encrypted gradient C G Finally, update the project configuration file with the ciphertext: Then, the server updates the latest C v Available for download by all users; D. Iterate steps B and C until a certain number of iterations is reached.