A social recommendation method based on differential privacy
By using differential privacy technology and the Laplace distribution noise generation mechanism, combined with social regularization and collaborative filtering, the latent vector update of the recommendation system is optimized, which solves the balance problem between privacy protection and recommendation effect in existing technologies, and achieves accurate personalized recommendations and user data security.
Patent Information
- Application Number
- CN202311149119.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-07
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2043-09-07
AI Technical Summary
Existing privacy protection models such as k-anonymity and homomorphic encryption have problems with insufficient security or excessive computational overhead in recommendation systems, making it difficult to effectively protect user privacy and provide good recommendation results.
Differential privacy technology is used, combined with the infinite divisibility of Laplace distribution to design a noise generation mechanism. Through multiple rounds of iterative interaction between the user end and the recommendation server, latent vectors of users and items are generated and updated. Combined with social regularization terms and collaborative filtering ideas, the recommendation effect is optimized.
While protecting user privacy, it provides accurate personalized recommendations, resists malicious attacks and theft, reduces the impact of noise on recommendation results, and meets the security requirements of ε-differential privacy.
Smart Images

Figure CN119598031B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of information security, privacy protection and recommendation systems, and specifically to a social recommendation method based on differential privacy. Background Art
[0002] Common privacy-preserving models such as k-anonymity and homomorphic encryption have been applied to recommendation systems to control the leakage of user privacy. However, k-anonymity limits assumptions about the attacker's background knowledge, and after generalization, the sensitive attributes of a group of users may be the same. This makes it vulnerable to background attacks and similar attacks, making it insecure for privacy protection. While cryptographic schemes such as homomorphic encryption can provide sufficient security, their high computational overhead makes them difficult to implement in real-world scenarios. In comparison, differential privacy has a lower computational overhead and provides a strict and quantitative concept of privacy, limiting the difference in the algorithm's final output caused by a single record in the dataset. This ensures that even if an attacker knows all but one record in the dataset, they cannot infer information about the unknown record. Therefore, social recommendation methods based on differential privacy help provide good recommendation results while protecting user privacy. Summary of the Invention
[0003] This invention provides a social recommendation method based on differential privacy. The main purpose of this invention is to protect user privacy while providing good recommendation results. It ensures that attackers cannot infer users' specific private data from related information such as user historical ratings and social relationships. At the same time, it provides a high-quality, low-overhead recommendation method for service providers such as governments and enterprises, increases user satisfaction and user stickiness in various application scenarios, and helps service providers better understand user needs. See the following description for details:
[0004] A social recommendation method based on differential privacy, the method comprising:
[0005] Step 1: The user collects his / her own historical rating data on the local client and initializes his / her own latent vector The recommendation server collects and generates the current item set and initializes the item description matrix where u i represents the hidden vector of the i-th user, which is a d-dimensional vector in the real field. V represents the item description matrix, which consists of the hidden vectors of each item, that is, v j Composition, v j is a d-dimensional vector in the real field, V is a d-row and m-column matrix in the real field, where m represents the total number of items;
[0006] Step 2: For each item in the dataset, the recommendation server calculates the total number of users n who have rated this item. jto the users who have rated it, where n j represents the total number of users who have rated the jth item j ;
[0007] Step 3: After receiving the number, the user generates noise based on the infinite divisibility of Laplace distribution where the symbol represents the noise generated by the user i for the item j, which is in the form of a d-dimensional vector in the real number field. Then, the user sends the intermediate result to the recommendation server;
[0008] Step 4: The recommendation server aggregates all the collected intermediate results and updates the item hidden vector
[0009] Step 5: While the recommendation server updates the item hidden vector, the user updates his own user hidden vector based on the social regularization term at the local client. First, the user sends the total number of friends |F i | to his friends;
[0010] Step 6: After receiving the total number |F i |, the user's friends, i.e. other users in the current social media that the user trusts through following, marking, etc., also generate noise based on the infinite divisibility of Laplace where the symbol represents the noise generated by the friend f of the user i when optimizing the item j, which is in the form of a d-dimensional vector in the real number field. Then, the user's friends send the intermediate result to the user, where represents the similarity between the user i and the friend user f for the item j, u f represents the hidden vector of the user f;
[0011] Step 7: Other users who have rated the item generate noise where the symbol represents the noise generated by the other user c who has rated the item j for the user i, which is in the form of a d-dimensional vector in the real number field. After generating the noise, the other user sends the intermediate result to the current user, where represents the similarity between the user i and the user c for the item j, u c represents the hidden vector of the user c;
[0012] Step 8: The user aggregates all the intermediate results collected from the friends and other rating users and updates his own hidden vector
[0013] Step 9: The above steps 2-8 are iterated until convergence, and the final item latent matrix is calculated by the recommendation server and sent to the user side, and the user side updates the item latent matrix by calculating the prediction value of the score of each item given by the user, and the recommendation server recommends the items with high scores to the current user.
[0014] Further, the noise generation method in step 3 above specifically includes:
[0015] (1) User i generates an intermediate result based on Gamma distribution Where G 1i , G 2i are d-dimensional vectors in the real field, and each element in the vector is an independent and random variable conforming to Gamma distribution. represents the shape parameter of Gamma distribution , the inverse scale parameter is , and let Then its probability density function is: The inverse scale parameter Δ is the difference between the maximum score and the minimum score in the current recommendation system, and ε is the privacy budget;
[0016] (2) User calculates as the noise generated by user i for item j.
[0017] Further, in step 4, the recommendation server aggregates the intermediate results and updates the item latent vector, specifically including:
[0018] (1) The recommendation server collects the intermediate results and calculates the gradient value of the optimized item j latent vector in the current round according to the formula
[0019]
[0020]
[0021] (2) The recommendation server updates the current item latent vector according to the formula
[0022] Further, in step 8, the user aggregates the intermediate results of friends and other users who score a certain item and updates the self latent vector, specifically including:
[0023] (1) The user collects the intermediate results and calculates the gradient value of the optimized self latent vector in the current round, and the gradient formula is as follows:
[0024]
[0025] (2) The user updates the self latent vector according to the formula
[0026] Compared with the prior art, the technical scheme of the present application has the beneficial effects that:
[0027] 1. The present application is based on differential privacy technology to protect user historical rating records while providing better recommendation results for users. A new noise generation mechanism is designed according to the infinite divisibility of Laplace distribution, and the size of the privacy budget is determined, so that the intermediate data and results can resist attacks such as stealing and reasoning by malicious users or recommendation services, while reducing the impact of noise on the recommendation results, and it can be theoretically proved to comply with ε-differential privacy.
[0028] 2. The recommendation scheme proposed in the present application considers social regularization terms and user-based collaborative filtering ideas at the same time. For each individual item, the influence of social relationships between users and similar preferences between users on user's own preferences is considered in detail, so that the rating prediction is more accurate, and better recommendation results can be provided. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 A system block diagram of a social recommendation method based on differential privacy provided by the present application is provided.
[0030] Figure 2 A flowchart of a social recommendation method based on differential privacy provided by the present application is provided. DETAILED DESCRIPTION
[0031] The present application will be further described in detail below in combination with the drawings and specific embodiments. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application.
[0032] The social recommendation method based on differential privacy can provide good recommendation results while protecting user privacy. Among them, the scheme combining differential privacy and matrix decomposition is one of the main methods of recommendation system. The core idea of matrix decomposition is to decompose the high-dimensional sparse matrix into two low-dimensional dense matrices, namely user description matrix and item description matrix, which will be used to predict the rating of the user on the purchased items, and then provide personalized recommendations for users according to the rating data.
[0033] Currently, recommendation methods combining differential privacy and matrix factorization can be mainly divided into two categories: recommendation methods based on trusted servers and recommendation methods considering untrusted servers. In the trusted server scenario, the recommendation server is considered completely trusted, and usually adds noise to the user's historical ratings by using centralized differential privacy technology to protect the true value. However, for economic benefits and other reasons, the recommendation server may misuse or sell the personal information contained in the user's historical ratings, so it is not completely trusted. In the untrusted server scenario, while preventing malicious users or malicious attackers, it is also necessary to prevent inference attacks and other information stealing attacks that the recommendation server may conduct, and a balance needs to be struck between privacy protection and recommendation effectiveness, that is, to provide sufficient privacy protection to prevent the personal information of users or the privacy information that can be inferred from the personal information from being stolen by malicious users, recommendation servers or malicious attackers, and to provide good personalized recommendations to users to increase user stickiness and improve system usability.
[0034] The application provides a satire detection method based on common sense enhanced emotional dependence graph, aiming to achieve the following objectives: 1. seeking a balance between recommendation effectiveness and user data privacy protection. The historical rating data of users can be protected to protect the privacy information of users, so that the users are protected from attacks by external malicious attackers, malicious users and untrusted recommendation servers, and better personalized recommendation effectiveness can be provided for users. 2. improving the accuracy of recommendation. Social information is fully utilized and the remaining information contained in the historical rating data is more thoroughly mined, the influence of the social relationship between users and the similar preferences between users on the preferences of users is comprehensively considered, and more accurate rating prediction is provided to improve the personalized recommendation effectiveness.
[0035] The application embodiment provides a socialized recommendation method based on differential privacy, and a system block diagram thereof is shown in the figure. Figure 1 In the application embodiment, two types of entities are mainly involved: users and recommendation servers.
[0036] 1. Users: Rate the items they have purchased in the social media system to generate a historical rating dataset, which includes three parts: user ID, item ID, and rating value (numeric, for example, any value between 1-5). Users generate social trust relationships in the social media by following and other behaviors. In this method, the trust relationship is a directed binary data, that is, if a user trusts another user, the trust relationship is 1, otherwise the trust relationship is 0. The trust relationship of a user itself will generate a social relationship dataset, which includes two parts: user ID and trusted user ID. There may be semi-honest users in the user set, that is, some users will try to obtain the historical rating values of other users in the process although they will follow the process. For the convenience of understanding, in the following, the personalized recommendation method process will be described for a certain user, and the friend set of the user and the other user set that rated a certain item will be used to describe the process, but it should be noted that both the friend set and the other user set are users in this method, and will be recommended to participate in the recommendation system as recommended users.
[0037] 2. Recommendation server: Maintains the current item set, updates the latent vector of each item in each round, and discloses the final item description matrix to each user. In this method, the recommendation server is considered to be semi-honest, that is, although it will follow the process, it may try to obtain the historical rating values of users due to curiosity or interest.
[0038] The threat model of the method is as follows:
[0039] 1. External malicious attackers try to obtain the historical rating data of users for interest and other reasons, and then infer the private information of users, which may implement data theft attacks or reasoning attacks;
[0040] 2. The recommendation server may be semi-honest, and can strictly implement the recommendation process according to the method, but may be curious about some user data and try to obtain it, or implement reasoning attacks by analyzing the results;
[0041] 3. Some users, even if they are temporarily trusted by some people, may be semi-honest, although they will execute the recommendation method, but are curious about user data and want to get the personal data of other users, which may implement reasoning attacks.
[0042] The method process provided by the example of the application is shown in Figure 2 , and the specific description is as follows:
[0043] The method is based on differential privacy and matrix decomposition technology, and the original high-dimensional sparse rating matrix is decomposed into two low-dimensional dense matrices, that is, the user description matrix and the item description matrix where d denotes the number of hidden factors, i.e. the number of hidden features of users and items. For example, if an item in the item description matrix is a movie, its features can be different types of movie features such as action, comedy, etc. The total number of types is the number of hidden factors. The recommendation server is responsible for maintaining the item description matrix V throughout the whole process, i.e. updating all the item hidden vectors in each iteration For each item, the server will receive the intermediate results sent by all users who have scored it in each iteration process, and is responsible for aggregating the intermediate results to update the item hidden vector. The user is responsible for maintaining and updating his own user hidden vector throughout the whole process Meanwhile, it needs to interact with the recommendation server and other users. Specifically, the user generates noise for the items, friend users and users who have scored the same item maintained by the recommendation server based on Laplace differential privacy and adds it to the intermediate results, and sends it to the target server or user, so that the server can aggregate the results to update the item hidden vector, and the user can aggregate the intermediate results to update the user hidden vector. Finally, after several iterations and convergence, the recommendation server sends the finally calculated item description matrix to each user, the user calculates the product of his own hidden vector and the item matrix to obtain the prediction value, and obtains the recommendation according to the prediction result.
[0044] The method perturbs the objective function based on Laplace differential privacy to ensure the security of user data, which needs multiple iterations, and the user needs to interact with the server and other users multiple times in each iteration. The overall process of the method is shown in Algorithm 1:
[0045]
[0046] The algorithm input includes the following 7 parts:
[0047] (1) Objective function, the objective function of the method is as shown in formula (1), where the symbols appearing will be described in detail in the subsequent description and process steps:
[0048]
[0049] (2) ε: privacy budget, in privacy protection, the smaller the privacy budget, the higher the protection level.
[0050] (3) γ: learning rate, which represents the step size of each iteration in the iterative learning process.
[0051] (4) α: the influence weight of social regularization term, i.e. the influence size of friends on their own interests.
[0052] (5) β: the influence weight based on the idea of user-based collaborative filtering, i.e. the influence size of other users who have scored the same item on their own interests.
[0053] (6)λ: Matrix regularization coefficient, used to prevent overfitting.
[0054] (7) Original data: including user historical rating data, user social relationship data, and item datasets maintained by the recommendation server.
[0055] The algorithm output is Contains the predicted ratings of each user for each item in the current system, based on which users will receive personalized recommendations.
[0056] This method consists of 9 steps, which can be divided into 3 stages, as detailed below:
[0057] 1. Initialization phase
[0058] The initialization phase includes step 1, which completes data collection and initialization of the user description matrix and item description matrix. The specific steps are as follows:
[0059] Step 1: The user collects his / her own historical rating data and social relationship data on the local client and initializes his / her own latent vector The recommendation server collects and generates the current item set and initializes the item description matrix where u i represents the hidden vector of the i-th user, which is a d-dimensional vector in the real field. V represents the item description matrix, which consists of the hidden vectors of each item, that is, v j Composition, v j is a d-dimensional vector in the real number field, V is a d-row and m-column matrix in the real number field, where m represents the total number of items.
[0060] 2. Iterative calculation stage
[0061] The iterative calculation stage includes steps 2-8, which can be represented as three layers of loops in the algorithm. The first layer of loop is the training round, i.e., the end condition of the iterative calculation stage is the convergence of the objective function (see formula (1)); the second layer of loop is the traversal operation on each item in each round; the third layer of loop is the consideration of each user who has scored the item when traversing each item. Through the second and third layers of loops, the method can complete the traversal of each item and each user in each round, i.e., the traversal of the existing historical rating records on the system. For the convenience of understanding, the following steps are described for the update of the hidden vector of an item and a user in a round. It should be noted that in the following text, for the convenience of description, we use the user's friend set and the set of other users who have scored a certain item to describe the process to depict the specific process of updating the hidden vector of a certain user, but it should be noted that the users mentioned in this context, whether it is the friend set or the set of other users, are users in this method, and will all participate in the recommendation system as recommended users in the traversal process. The steps are described in detail as follows:
[0062] Step 2: For each item in the data set, the recommendation server will send the total number of users n j who have scored the item to the users who have scored it, where n j represents the total number of users who have scored the jth item.
[0063] Step 3: After receiving the number, the user generates noise based on the infinite divisibility of the Laplace distribution where the symbol represents the noise generated by user i for item j, which is in the form of a d-dimensional vector in the real number field. Then, the user sends the intermediate result to the recommendation server. Where Rij represents the rating value of the ith user for the jth item, and the noise generation method is as follows:
[0064] (1) User i generates the intermediate result based on the Gamma distribution 1i where G 2i are d-dimensional vectors in the real number field, and each element in the vector is an independent and random variable conforming to the Gamma distribution. represents the Gamma distribution with shape parameter and inverse scale parameter , let then its probability density function is: The inverse scale parameter Δ is the difference between the maximum and minimum ratings in the current recommendation system, and ε is the privacy budget.
[0065] (2) User calculates noise generated by user i for item j.
[0066] Step 4: The recommendation server aggregates all the intermediate results collected and updates the item latent vector based on this where, denotes the gradient value of the item latent vector, which is calculated according to the objective function (formula (1)). In the objective function and the above gradient, I ij denotes whether the i-th user has rated the j-th item, if rated, the value is 1, otherwise 0.
[0067] Step 5: While the recommendation server updates the item latent vector, the user updates his own user latent vector based on the social regularization term at the local client. First, the user sends the total number of friends |F i | to his friends.
[0068] Step 6: After receiving the total number |F i | of friends, the user's friends, i.e. other users that the user trusts in the current social media through following, marking, etc. also generate noise where the symbol denotes the noise generated by the user i's friend f when optimizing item j, which is a d-dimensional vector in the real number field, and the noise generation method is similar to step 3, the difference is only that is, the parameters of the Gamma distribution are different. After that, the user's friends send the intermediate result to the user, where denotes the similarity between user i and his friend user f for item j, which uses u f denotes the latent vector of user f.
[0069] Step 7: Other users who have rated the item generate noise where the symbol denotes the noise generated by other users c who have rated the item j for user i, which is a d-dimensional vector in the real number field, and the noise generation method is similar to step 3, the difference is only After the noise is generated, the other users send the intermediate result to the current user, where denotes the similarity between user i and user c for item j, u c denotes the latent vector of user c.
[0070] Step 8: The user aggregates all the intermediate results collected at the friends and other rating users and updates his own latent vector where, The gradient value of the user implicit vector is represented as shown below, and is also calculated according to the target function (formula (1)).
[0071]
[0072] The above steps are iteratively run for each item and each user in each round until convergence, and the final item description matrix and user description matrix are obtained
[0073] III. Result acquisition stage
[0074] The result acquisition includes step 9, which finally generates the predicted value of the user's score for each item and makes recommendations based on it, which is described as follows:
[0075] Step 9: The recommendation server sends the finally calculated item description matrix to the user side, and the user side calculates the predicted value of the user's score for each item, and the recommendation server recommends the items with high scores to the current user.
[0076] The security analysis of the method provided by the embodiment of the application is as follows:
[0077] 1. The method meets the epsilon-differential privacy
[0078] First, according to the infinity of Laplace, there is where The infinity of Laplace is described as follows:
[0079] Infinity of Laplace: Let represent a Laplace distribution with a location parameter of θ and a scale parameter of s, then it satisfies the infinity of Laplace, specifically, for n≥1, there is Each X i is a distribution consistent with θ / n+Y 1n -Y 2n , where Y 1n and Y 2n are gamma independent distributions.
[0080] Suppose D1 and D2 are two data sets that differ only in one record, and the record that differs exists in the two data sets, respectively R ij and The same output, i.e., the same V, will be generated from the two different data sets, and V is the result finally obtained after multiple rounds of iteration convergence, so there is Therefore, there is
[0081]
[0082] Since there is only one record in both datasets, i.e. R ij and are different, so there is Since and ||ui||<=1, so there is
[0083] For each item latent vector v j in V, there is
[0084]
[0085] Therefore, the final item description matrix V satisfies the e-differential privacy.
[0086] The infinite divisibility of the Laplace distribution is stable, and there is where B n-1 is a random variable subject to the Beta distribution with parameters 1 and n-1. In the process of updating the user's latent vector, there is Further, there is Similar to the proof process that the item description matrix satisfies the e-differential privacy, the latent vector of each user also satisfies the e-differential privacy.
[0087] 2. Attack resistance analysis
[0088] The method uses differential privacy to perturb the objective function, and adds noise to the gradient to prevent the original rating of the user or the user's latent vector from being stolen. For the stealing attack that the external malicious attacker can make, since only the intermediate result added with noise is transmitted in the transmission process, and there is no any plaintext, the attacker cannot obtain the original rating data or the real user's latent vector, and can only obtain the disturbed result without any meaning, so the stealing attack can be effectively resisted. For the inference attack that the external malicious attacker, the semi-honest recommendation server and the semi-honest user can make, since the noise is added in the gradient and the different noise generated by each user is updated once in each round, any effective information cannot be analyzed from it, so the inference attack can be effectively resisted.
[0089] Those skilled in the art can clearly understand the above-mentioned embodiments can be implemented by software, or can be implemented by means of software plus necessary general hardware platform. Based on such understanding, the technical solutions of the above-mentioned embodiments can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be CD-ROM, U disk, mobile hard disk, etc.), including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the method described in each embodiment of the application.
[0090] Those skilled in the art can understand that the drawings are only schematic illustrations of a preferred embodiment, and the above-mentioned embodiment numbers of the application are only for description, not representing the advantages and disadvantages of the embodiments.
[0091] The above description is only the preferred embodiment of the application, and is not intended to limit the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the application shall be included in the protection scope of the application.
Claims
1. A social recommendation method based on differential privacy, characterized in that: The following steps are involved: (101) Step 1: The user collects his / her own historical rating data on the local client and initializes his / her own latent vector The recommendation server collects and generates the current item set and initializes the item description matrix where u i represents the hidden vector of the i-th user, which is a d-dimensional vector in the real field. V represents the item description matrix, which consists of the hidden vectors of each item, that is, v j Composition, v j is a d-dimensional vector in the real field, V is a d-row and m-column matrix in the real field, where m represents the total number of items; (102) Step 2: For each item in the dataset, the recommendation server calculates the total number of users n who have rated this item. j Sent to users who have rated it, where n j Represents the total number of users n who rated the jth item j ; (103) Step 3: After receiving the number, the user generates noise based on the infinite divisibility of the Laplace distribution The symbols Represents the noise generated by user i on item j, which is in the form of a d-dimensional vector in the real field. After that, the user sends the intermediate result To the recommended server; (104) The recommendation server aggregates all the collected intermediate results and updates the item latent vector based on them (105) Step 5: While the recommendation server is updating the item latent vector, the user updates his own user latent vector based on the social regularization term on the local client. The user sends the total number of his friends |F i |To your friends; (106) Step 6: The user’s friends, i.e. other users trusted by the user in the current social media through following, tagging, etc., receive the total number of |F i |After that, noise is generated based on the infinite divisibility of Laplace. The symbols It represents the noise generated by user i's friend f when optimizing item j, which is in the form of a d-dimensional vector in the real field. Afterwards, the user's friend will Sent to the user, where Indicates the similarity between user i and his friend user f for item j, u f represents the latent vector of user f; (107) Other users who have rated the item generate noise respectively The symbols It represents the noise generated by other users c who have rated item j to user i. Its form is a d-dimensional vector in the real field. After the noise is generated, other users will use the intermediate results Sent to the current user, where Indicates the similarity between user i and user c for item j, u c represents the latent vector of user c; (108) Step 8: The user aggregates all intermediate results collected from friends and other scoring users and updates his own latent vector (109) The above steps 2-8 are iterated continuously until convergence. The recommendation server calculates the final item hidden matrix and sends it to the user. The user side calculates The predicted values of the user's ratings for each item are obtained, and the recommendation server recommends the items with higher scores to the current user.
2. The social recommendation method based on differential privacy according to claim 1, characterized in that: The noise generation method is specifically as follows: (201) User i generates an intermediate result G based on the Gamma distribution 1i , Among them G 1i , G 2i are d-dimensional vectors over the real number field, and each element in the vector is an independent and random variable that conforms to the Gamma distribution; The shape parameter is The inverse scale parameter is Gamma distribution, let Then its probability density function is: x≥0, where Δ in the inverse scaling parameter is the difference between the maximum and minimum ratings in the current recommendation system, and ε is the privacy budget; (202) User Computing as the noise generated by user i for item j.
3. The social recommendation method based on differential privacy according to claim 1, characterized in that: The method for the recommendation server to aggregate intermediate results and update item latent vectors is specifically as follows: (301) The recommendation server collects the intermediate results and uses the formula Calculate the gradient value of the hidden vector of item j in the current round of optimization; (302) Recommended server according to the formula Update the latent vector of the current item.
4. The social recommendation method based on differential privacy according to claim 1, characterized in that: The user aggregates the intermediate results of friends and other users who score an item and updates their own latent vector specifically including: (401) The user collects the intermediate results and calculates the gradient value of the current round of optimization of its own latent vector. The gradient formula is as follows: (402) User according to the formula Update its own latent vector.