A personalized differential privacy and gradient perturbation recommendation method

By combining personalized differential privacy with gradient perturbation, the problem of inflexible privacy protection in recommender systems is solved, achieving a balance between recommendation accuracy and privacy protection, and improving the usability and fairness of the system.

CN122132631APending Publication Date: 2026-06-02CHONGQING UNIV OF POSTS & TELECOMM

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING UNIV OF POSTS & TELECOMM
Filing Date
2026-03-04
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing recommendation systems struggle to balance protecting user privacy with recommendation accuracy, especially since traditional differential privacy mechanisms ignore differences in users' privacy sensitivities, resulting in insufficient flexibility in privacy protection.

Method used

We employ a combination of personalized differential privacy and gradient perturbation. By randomly initializing matrix factorization, grouping sampling, gradient pruning, and adding noise, we dynamically adjust the privacy protection level to achieve personalized privacy protection and recommendation model optimization.

Benefits of technology

While protecting user privacy, it improves the usability and fairness of the recommendation system, dynamically adjusts the gradient pruning threshold to balance model training efficiency and privacy protection, and achieves personalized recommendation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122132631A_ABST
    Figure CN122132631A_ABST
Patent Text Reader

Abstract

This invention discloses a recommendation method based on personalized differential privacy and gradient perturbation, belonging to the interdisciplinary field of computer recommendation systems and information security. The method uses an implicit feedback matrix to represent user-item interaction data, randomly initializes user and item latent factor matrices, and constructs and optimizes the objective function through Bayesian personalized ranking matrix decomposition to obtain the user latent factor matrix. In privacy-preserving training, the dataset is divided into groups for sampling, and the sampling rate is calculated by combining the privacy budget, failure probability, and iteration count of each group, and a training subset is extracted. An objective function is constructed separately for the matrix, the gradient is clipped using the L2 norm and the threshold is adaptively adjusted, and Gaussian noise is added to achieve gradient perturbation, thus iteratively updating the matrix. Finally, the matrix is ​​shared, and users calculate predicted ratings locally, rank uninterrupted items, and select items to complete the recommendation. This invention effectively improves the accuracy of the recommendation model while achieving privacy protection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of computer recommendation systems and information security, and relates to a recommendation method based on personalized differential privacy and gradient perturbation. Background Technology

[0002] With the rapid development of mobile internet and big data technologies, recommender systems have become a core hub connecting users with massive amounts of information, playing a crucial role in e-commerce, social media, online education, and other fields. However, while improving information distribution efficiency, recommender systems also face serious risks of user privacy leakage. In the process of collecting and analyzing users' historical behavioral data (such as ratings, clicks, and browsing history) to build personalized recommendation models, systems are highly susceptible to exposing users' sensitive information, leading to privacy abuse and trust crises. How to effectively protect user privacy while ensuring recommendation accuracy has become a key challenge in recommender system research. Differential privacy, as a privacy protection framework with a rigorous mathematical foundation, has been widely introduced into recommender systems in recent years due to its provable security, resistance to backdoor attacks, and robustness to arbitrary background knowledge. By introducing controlled noise during data release or model training, differential privacy can ensure the availability of group statistical features without exposing individual data. However, traditional differential privacy mechanisms often employ a "one-size-fits-all" noise injection strategy, ignoring the differences in privacy sensitivity among different users—some users may be willing to sacrifice some privacy for higher recommendation quality, while others are extremely sensitive to data exposure. This heterogeneous demand has given rise to the concept of Personalized Differential Privacy (PDP), which allows different users to set personalized levels of privacy protection, thereby achieving a flexible trade-off between privacy and utility. Combining PDP with recommender systems not only respects users' individual privacy preferences but also improves the overall usability and fairness of the system. Summary of the Invention

[0003] In view of this, the purpose of this invention is to provide a recommendation method based on personalized differential privacy and gradient perturbation, which achieves a good balance between security and usability in matrix factorization recommendation models.

[0004] To achieve the above objectives, the present invention provides the following technical solution:

[0005] 1. A recommendation method based on personalized differential privacy and gradient perturbation, characterized in that the method specifically includes the following steps:

[0006] S1: Use an implicit feedback matrix consisting of 0 and 1 to represent user feedback data on the project, where 0 indicates negative feedback from the user and 1 indicates positive feedback from the user.

[0007] S2: Randomly initialize the matrix , , ; It is the user latent factor matrix. Representation matrix The , representing the first Latent factor vectors of each user; It is the project latent factor matrix. Representation matrix The Line, representing the first Latent factor vectors for each project; It is the latent factor matrix of the noisy project. Representation matrix The Line, representing the first The latent factor vector of each item with added noise; The dimension of the latent factor vector;

[0008] S3: Building the dataset With objective function A matrix factorization recommendation method based on Bayesian personalized ranking is used to solve the user matrix. and project matrix and will Save the results;

[0009] S4: Randomly initialize the matrix Based on a privacy-preserving grouping sampling strategy during the training phase, the initial triplet dataset D is divided into P independent groups. Combined with a preset group privacy budget failure probability Given the iteration number I, calculate the personalized sampling rate for each group. The training subset for this round is obtained by randomly sampling from each group according to this sampling rate. The matrix obtained in S3 Input, based on the current sampling subset Build only objective function ,calculate gradient ;

[0010] S5: Gradient based on sensitivity Perform norm 2 clipping. If the gradient exceeds the clipping threshold C, scale it down to the threshold range. Calculate the proportion of gradient-triggered clipping occurrences in the current training iteration relative to the total number of gradient calculations. If this frequency exceeds a preset clipping frequency threshold, apply a decay factor. The current pruning threshold is updated by decay; if it is not exceeded, the pruning threshold C is kept unchanged, thereby dynamically balancing gradient sensitivity control and model training efficiency.

[0011] S6: Sample noise from a Gaussian distribution and apply it to the gradient. By adding the corresponding noise, we obtain the perturbed gradient. The perturbated gradient Used for updating ;

[0012] S7: According to the formula Make predictions, and process the prediction results of the non-positive feedback items in the implicit feedback matrix described in S1.

[0013] Sort by row and recommend the top-K items to the user.

[0014] 2. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1 is characterized in that: in step S1, the implicit feedback data of users to items is converted into an implicit feedback matrix composed of 0 and 1. Used to represent users For the project The feedback information; where a value of 0 indicates negative user feedback on the project, and a value of 1 indicates positive user feedback on the project. This represents a set containing all users. This represents a collection containing all items. , Representing user sets respectively The number of users and the collection of projects Number of projects in China.

[0015] 3. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1 is characterized in that: in step S3, a dataset is constructed. With objective function A matrix factorization recommendation method based on Bayesian personalized ranking is used to solve the user matrix. and project matrix and will The results are saved by following these steps:

[0016] S31: Construct a dataset consisting of multiple triples, where each triple contains a user. A project that has been interacted with by users And a project that the user has not interacted with. For implicit feedback matrices Each non-zero element in the data, from the user Randomly selected from the collection of items that have not been interacted with For each item, generate the corresponding triplet. Based on the generated dataset The implicit feedback matrix is ​​decomposed into two low-dimensional matrices. and And define a user matrix and project matrix Objective function:

[0017]

[0018] in, Represents the loss function. Represents the regularization coefficient of the user vector. , represent the regularization coefficients for the user's vectors and the vectors of interacting and non-interacting items, respectively. Indicates the norm used;

[0019] S32: Optimize the objective function using stochastic gradient descent. Randomly selected from the dataset Triples drawn from the middle Calculate the objective function for , , gradient , , Subsequently, the user's latent factor vector is updated using these gradients. and project latent factor vector , The specific update rules are as follows:

[0020]

[0021]

[0022]

[0023] in Let represent the learning rate, and the formula for calculating the gradient is as follows:

[0024]

[0025]

[0026]

[0027] Repeat step S3 above. , Perform iterations. , The iteration ends and the matrix is ​​saved when the stopping condition is met. .

[0028] 4. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1 is characterized in that: in step S4, the matrix is ​​randomly initialized. Based on a privacy-preserving grouping sampling strategy during the training phase, the initial triplet dataset D is divided into P independent groups. Combined with a preset group privacy budget failure probability Given the iteration number I, calculate the personalized sampling rate for each group. The training subset for this round is obtained by randomly sampling from each group according to this sampling rate. The matrix obtained in S3 Input, based on the current sampling subset Build only objective function ,calculate gradient Specifically, the following steps are included:

[0029] S41: Based on data distribution characteristics, the initial triplet dataset... Divide into P independent and non-overlapping groups Each group The corresponding number of data points is The following conditions must be met:

[0030]

[0031] S42: Based on the preset privacy budgets for each group Differential privacy failure probability The total number of iterations for privacy protection training is I, and the solution satisfies... - Minimum Noise Multiplier for Differential Privacy The calculation is as follows:

[0032]

[0033] Where q is the global base sampling rate;

[0034] S43: Then multiply by the noise As input, a binary search algorithm is used to find the privacy budget for each group. initial sampling rate It satisfies:

[0035]

[0036] S44: Sampling rate for each group in the initial solution Perform a global calibration to verify whether its weighted sum matches the global base sampling rate q. The verification formula is:

[0037]

[0038] S45: If the equation is not satisfied, adjust the noise multiplier according to the scaling factor. Then, the sampling rates for each group are recalculated until the equation holds true, ultimately yielding the calibrated personalized sampling rates for each group. Based on this calibrated sampling rate, for each group Perform random sampling to obtain the final sampled dataset for this round of training. ;

[0039] S46: Based on the current sampling subset Rebuild only objective function ,calculate gradient :

[0040]

[0041] in, Indicates to users Interactive projects The latent factor vector, Indicates to users Items that have not been interacted with The vector, , Respectively representing users The regularization coefficients of the latent factor vectors of interactive and non-interactive items. express Norm;

[0042] S47: For the dataset Any triplet Find the objective function respectively. about and gradient and The calculation formula is as follows:

[0043]

[0044]

[0045] 5. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1 is characterized in that: in step S5, the gradient is adjusted according to sensitivity. Perform norm 2 clipping. If the gradient exceeds the clipping threshold C, scale it down to the threshold range. Calculate the proportion of gradient-triggered clipping occurrences in the current training iteration relative to the total number of gradient calculations. If this frequency exceeds a preset clipping frequency threshold, apply a decay factor. The current clipping threshold is updated with a decay effect; if it is not exceeded, the clipping threshold C remains unchanged. This includes the following steps:

[0046] S51: After obtaining the positive feedback project vector gradient and negative feedback item vector gradient Then, trim them:

[0047]

[0048]

[0049] in, , They represent , The gradient after clipping, where C is the clipping threshold;

[0050] S52: Determine if clipping has been triggered. or but:

[0051] ,

[0052] S53: Let the total number of samples in this round be , then the pruning trigger frequency in this round is:

[0053] ,

[0054] S54: Dynamically update the clipping threshold based on the clipping frequency:

[0055]

[0056] Where τ is the preset cropping frequency threshold. This is the threshold attenuation coefficient;

[0057] S55: After each training round, aggregate the clipped gradients:

[0058]

[0059]

[0060] in, yes The i-th row represents the calculations of user u. The gradient; Indicates the calculation by user u The gradient.

[0061] 6. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1 is characterized in that: in step S6,

[0062] S61: The gradient we obtained in step 5 Adding a mean of 0 and a variance of Gaussian noise perturbation get :

[0063]

[0064] S62: Then use the perturbed gradient to update :

[0065]

[0066] in It is the learning rate.

[0067] 7. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1 is characterized in that: in step S7, the finally generated item latent factor matrix is... Distributed to each user, user Calculate the predicted value on its device Unobserved interactions are sorted in descending order based on predicted values, and finally the top ones are selected. Recommend a project to users .

[0068] This invention addresses the privacy leakage problem inherent in implicit matrix factorization, while also considering the varying privacy protection needs of different groups by segmenting the data into groups. First, using matrix factorization, the implicit feedback data matrix of users to items is decomposed into two low-dimensional matrices, corresponding to the user latent factor matrix and the item latent factor matrix, respectively. While retaining the user latent factor matrix, corresponding samples are extracted from different data groups by adjusting the sampling rate to meet differentiated privacy protection requirements. Subsequently, an objective function oriented towards the item latent factor matrix is ​​constructed for the users participating in training, and stochastic gradient descent is used for optimization. During optimization, the proportion of users triggering gradient clipping is statistically analyzed. When the clipping rate exceeds a set threshold, the clipping threshold is dynamically adjusted to mitigate the impact on model performance caused by unsuitable gradient clipping parameters. The algorithm ensures the usability of the recommendation model while guaranteeing the security of user privacy data. Other advantages, objectives, and features of this invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of this invention can be realized and obtained through the following description. Attached Figure Description

[0069] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:

[0070] Figure 1 : Schematic diagram of a recommendation method based on personalized differential privacy and gradient perturbation;

[0071] Figure 2 : Comparison of the HR metrics between this invention and other methods under different privacy budgets;

[0072] Figure 3 : Comparison results of this invention with other methods on the NDCG metric under different privacy budgets. Detailed Implementation

[0073] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0074] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0075] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0076] Step S1: Convert the implicit feedback data of users to the project into an implicit feedback matrix consisting of 0s and 1s. Used to represent users For the project The feedback status; where a value of 0 indicates negative feedback from users to the project, and a value of 1 indicates positive feedback from users to the project. This represents a set containing all users. This represents a collection containing all items. , Representing user sets respectively The number of users and the collection of projects Number of projects in China.

[0077] Step S2: Randomly initialize the matrix , , ; It is the user latent factor matrix. Representation matrix The Line, representing the first Latent factor vectors of each user; It is the project latent factor matrix. Representation matrix The Line, representing the first Latent factor vectors for each project; It is the latent factor matrix of the noisy project. Representation matrix The Line, representing the first The latent factor vector of each item with added noise; This represents the dimension of the latent factor vector.

[0078] Step S3: Construct the dataset With objective function A matrix factorization recommendation method based on Bayesian personalized ranking is used to solve the user matrix. and project matrix and will The results are saved by following these steps:

[0079] S31: Construct a dataset consisting of multiple triples, where each triple contains a user. A project that has been interacted with by users And a project that the user has not interacted with. For implicit feedback matrices Each non-zero element in the data, from the user Randomly selected from the collection of items that have not been interacted with For each item, generate the corresponding triplet. Based on the generated dataset The implicit feedback matrix is ​​decomposed into two low-dimensional matrices. and And define a user matrix and project matrix Objective function:

[0080]

[0081] in, Represents the loss function. Represents the regularization coefficient of the user vector. , represent the regularization coefficients for the user's vectors and the vectors of interacting and non-interacting items, respectively. Indicates the norm used;

[0082] S32: Optimize the objective function using stochastic gradient descent. Randomly selected from the dataset Triples drawn from the middle Calculate the objective function for , , gradient , , Subsequently, the user's latent factor vector is updated using these gradients. and project latent factor vector , The specific update rules are as follows:

[0083]

[0084]

[0085]

[0086] in Let represent the learning rate, and the formula for calculating the gradient is as follows:

[0087]

[0088]

[0089]

[0090] Repeat step S3 above. , Perform iterations. , The iteration ends and the matrix is ​​saved when the stopping condition is met. .

[0091] Step S4: Randomly initialize the matrix Based on a privacy-preserving grouping sampling strategy during the training phase, the initial triplet dataset D is divided into P independent groups. Combined with a preset group privacy budget failure probability Given the iteration number I, calculate the personalized sampling rate for each group. The training subset for this round is obtained by randomly sampling from each group according to this sampling rate. The matrix obtained in S3 Input, based on the current sampling subset Build only objective function ,calculate gradient Specifically, the following steps are included:

[0092] S41: Based on data distribution characteristics, the initial triplet dataset... Divide into P independent and non-overlapping groups Each group The corresponding number of data points is The following conditions must be met:

[0093]

[0094] S42: Based on the preset privacy budgets for each group Differential privacy failure probability The total number of iterations for privacy protection training is I, and the solution satisfies... - Minimum Noise Multiplier for Differential Privacy The calculation is as follows:

[0095]

[0096] Where q is the global base sampling rate;

[0097] S43: Then multiply by the noise As input, a binary search algorithm is used to find the privacy budget for each group. initial sampling rate It satisfies:

[0098]

[0099] S44: Sampling rate for each group in the initial solution Perform a global calibration to verify whether its weighted sum matches the global base sampling rate q. The verification formula is:

[0100]

[0101] S45: If the equation is not satisfied, adjust the noise multiplier according to the scaling factor. Then, the sampling rates for each group are recalculated until the equation holds true, ultimately yielding the calibrated personalized sampling rates for each group. Based on this calibrated sampling rate, for each group Perform random sampling to obtain the final sampled dataset for this round of training. ;

[0102] S46: Based on the current sampling subset Rebuild only objective function ,calculate gradient :

[0103]

[0104] in, Indicates to users Interactive projects The latent factor vector, Indicates to users Items that have not been interacted with The vector, , Respectively representing users The regularization coefficients of the latent factor vectors of interactive and non-interactive items. express Norm;

[0105] S47: For the dataset Any triplet Find the objective function respectively. about and gradient and The calculation formula is as follows:

[0106]

[0107]

[0108] Step S5: Adjust the gradient based on sensitivity Perform norm 2 clipping. If the gradient exceeds the clipping threshold C, scale it down to the threshold range. Calculate the proportion of gradient-triggered clipping occurrences in the current training iteration relative to the total number of gradient calculations. If this frequency exceeds a preset clipping frequency threshold, apply a decay factor. The current clipping threshold is updated with a decay effect; if it is not exceeded, the clipping threshold C remains unchanged. This includes the following steps:

[0109] S51: After obtaining the positive feedback project vector gradient and negative feedback item vector gradient Then, trim them:

[0110]

[0111]

[0112] in, , They represent , The gradient after clipping, where C is the clipping threshold;

[0113] S52: Determine if clipping has been triggered. or but:

[0114] ,

[0115] S53: Let the total number of samples in this round be , then the pruning trigger frequency in this round is:

[0116] ,

[0117] S54: Dynamically update the clipping threshold based on the clipping frequency:

[0118]

[0119] Where τ is the preset cropping frequency threshold. This is the threshold attenuation coefficient;

[0120] S55: After each training round, aggregate the clipped gradients:

[0121]

[0122]

[0123] in, yes The i-th row represents the calculations of user u. The gradient; Indicates the calculation by user u The gradient.

[0124] Step S6:

[0125] S61: The gradient we obtained in step 5 Adding a mean of 0 and a variance of Gaussian noise perturbation get :

[0126]

[0127] S62: Then use the perturbed gradient to update :

[0128]

[0129] in It is the learning rate.

[0130] Step S7: Repeat steps 4, 5, and 6 to generate the final project latent factor matrix. Distributed to each user, user Calculate the predicted value on its device Unobserved interactions are sorted in descending order based on predicted values, and finally the top ones are selected. Recommend a project to users .

[0131] Example

[0132] Figure 1 As shown: User feedback data to the project is represented using an implicit feedback matrix consisting of 0s and 1s, where 0 represents negative feedback and 1 represents positive feedback. The user latent factor matrix is ​​randomly initialized. Project latent factor matrix ,in and project latent factor vector , These represent the latent factor vectors for users and projects, respectively, with the latent factor dimension being... Constructing the dataset and objective function. A matrix factorization method based on Bayesian personalized ranking is adopted to optimize and solve the problem. and And save the results. Randomly initialize the matrix. Based on a privacy-preserving grouping sampling strategy during the training phase, the initial triplet dataset D is divided into P independent groups. Combined with a preset group privacy budget failure probability Given the iteration number I, calculate the personalized sampling rate for each group. The training subset for this round is obtained by randomly sampling from each group according to this sampling rate. The matrix obtained in S3 Input, based on the current sampling subset Build only objective function ,calculate gradient Gradient based on sensitivity Perform norm 2 clipping. If the gradient exceeds the clipping threshold C, scale it down to the threshold range. Calculate the proportion of gradient-triggered clipping occurrences in the current training iteration relative to the total number of gradient calculations. If this frequency exceeds a preset clipping frequency threshold, apply a decay factor. The current clipping threshold is updated with a decaying effect; if it is not exceeded, the clipping threshold C is kept unchanged, and then noise is sampled from a Gaussian distribution to adjust the gradient. By adding the corresponding noise, we obtain the perturbed gradient. The perturbated gradient Used for updating The repeated update process yields the final project latent factor matrix. Distributed to each user, user Calculate the predicted value on its device Unobserved interactions are sorted in descending order based on predicted values, and finally the top ones are selected. Recommend a project to users Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A recommendation method based on personalized differential privacy and gradient perturbation, characterized in that, The method specifically includes the following steps: S1: Use an implicit feedback matrix consisting of 0 and 1 to represent user feedback data on the project, where 0 indicates negative feedback from the user and 1 indicates positive feedback from the user. S2: Randomly initialize the matrix , , ; It is the user latent factor matrix. Representation matrix The Line, representing the first Latent factor vectors of each user; It is the project latent factor matrix. Representation matrix The Line, representing the first Latent factor vectors for each project; It is the latent factor matrix of the noisy project. Representation matrix The Line, representing the first The latent factor vector of each item with added noise; Represents the dimension of the latent factor vector; S3: Building the dataset With objective function A matrix factorization recommendation method based on Bayesian personalized ranking is used to solve the user matrix. and project matrix and will Save the results; S4: Randomly initialize the matrix Based on a privacy-preserving grouping sampling strategy during the training phase, the initial triplet dataset D is divided into P independent groups. Combined with a preset group privacy budget failure probability Given the iteration number I, calculate the personalized sampling rate for each group. The training subset for this round is obtained by randomly sampling from each group according to this sampling rate. The matrix obtained in S3 Input, based on the current sampling subset Build only objective function ,calculate gradient ; S5: Gradient based on sensitivity Perform norm 2 clipping. If the gradient exceeds the clipping threshold C, scale it down to the threshold range. Calculate the proportion of gradient-triggered clipping occurrences in the current training iteration relative to the total number of gradient calculations. If this frequency exceeds a preset clipping frequency threshold, apply a decay factor. The current pruning threshold is updated by decay; if it is not exceeded, the pruning threshold C is kept unchanged, thereby dynamically balancing gradient sensitivity control and model training efficiency. S6: Sample noise from a Gaussian distribution and apply it to the gradient. By adding the corresponding noise, we obtain the perturbed gradient. The perturbated gradient Used for updating ; S7: According to the formula Make predictions, and process the prediction results of the non-positive feedback items in the implicit feedback matrix described in S1. Sort by row and recommend the top K items to the user.

2. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1, characterized in that: In step S1, the implicit feedback data of the user to the project is converted into an implicit feedback matrix consisting of 0s and 1s. Used to represent users For the project The feedback information; where a value of 0 indicates negative user feedback on the project, and a value of 1 indicates positive user feedback on the project. This represents a set containing all users. This represents a collection containing all items. , Representing user sets respectively The number of users and the collection of projects Number of projects in China.

3. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1, characterized in that: In step S3, the dataset is constructed. With objective function A matrix factorization recommendation method based on Bayesian personalized ranking is used to solve the user matrix. and project matrix and will The results are saved by following these steps: S31: Construct a dataset consisting of multiple triples, where each triple contains a user. A project that has been interacted with by users And a project that the user has not interacted with. For implicit feedback matrices Each non-zero element in the data, from the user Randomly selected from the collection of items that have not been interacted with For each item, generate the corresponding triplet. Based on the generated dataset The implicit feedback matrix is ​​decomposed into two low-dimensional matrices. and And define a user matrix and project matrix Objective function: , in, Represents the loss function. Represents the regularization coefficient of the user vector. , represent the regularization coefficients for the user's vectors and the vectors of interacting and non-interacting items, respectively. Indicates the norm used; S32: Optimize the objective function using stochastic gradient descent. Randomly selected from the dataset Triples drawn from the middle Calculate the objective function for , , gradient , , Subsequently, the user's latent factor vector is updated using these gradients. and project latent factor vector , The specific update rules are as follows: , , , in, This represents the learning rate; the formula for calculating the gradient is as follows: , , ; Repeat step S3 above. , Perform iterations. , The iteration ends and the matrix is ​​saved when the stopping condition is met. .

4. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1, characterized in that: In step S4, the matrix is ​​randomly initialized. Based on a privacy-preserving grouping sampling strategy during the training phase, the initial triplet dataset D is divided into P independent groups. Combined with a preset group privacy budget failure probability Given the iteration number I, calculate the personalized sampling rate for each group. The training subset for this round is obtained by randomly sampling from each group according to this sampling rate. The matrix obtained in S3 Input, based on the current sampling subset Build only objective function ,calculate gradient Specifically, the following steps are included: S41: Based on data distribution characteristics, the initial triplet dataset... Divide into P independent and non-overlapping groups Each group The corresponding number of data points is The following conditions must be met: ; S42: Based on the preset privacy budgets for each group Differential privacy failure probability The total number of iterations for privacy protection training is I, and the solution satisfies... - Least Noise Multiplier for Differential Privacy The calculation is as follows: , Where q is the global base sampling rate; S43: Then multiply by the noise As input, a binary search algorithm is used to find the privacy budget for each group. initial sampling rate It satisfies: ; S44: Sampling rate for each group in the initial solution Perform a global calibration to verify whether its weighted sum matches the global base sampling rate q. The verification formula is: ; S45: If the equation is not satisfied, adjust the noise multiplier according to the scaling factor. Then, the sampling rates for each group are recalculated until the equation holds true, ultimately yielding the calibrated personalized sampling rates for each group. Based on this calibrated sampling rate, for each group Perform random sampling to obtain the final sampled dataset for this round of training. ; S46: Based on the current sampling subset Rebuild only objective function ,calculate gradient : , in, Indicates to users Interactive projects The latent factor vector, Indicates to users Items that have not been interacted with The vector, , Respectively representing users The regularization coefficients of the latent factor vectors of interactive and non-interactive items. express Norm; S47: Dataset Any triplet Find the objective function respectively. about and gradient and The calculation formula is as follows: , 。 5. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1, characterized in that: In step S5, the gradient is adjusted according to the sensitivity. Perform L2-norm clipping; if the gradient exceeds the clipping threshold C, scale it down to the threshold range. The proportion of gradient-triggered clipping during this training round to the total number of gradient calculations is calculated. If this frequency exceeds a preset clipping frequency threshold, then clipping is performed using a decay factor. The current pruning threshold is updated by decay. If the threshold is not exceeded, the clipping threshold C remains unchanged, specifically including the following steps: S51: After obtaining the positive feedback project vector gradient and negative feedback item vector gradient Then, trim them: , , in, , They represent , The gradient after clipping, where C is the clipping threshold; S52: Determine if clipping is triggered. or but: , S53: Let the total number of samples in this round be , then the pruning trigger frequency in this round is: , S54: Dynamically update the clipping threshold based on the clipping frequency. , Where τ is the preset cropping frequency threshold. This is the threshold attenuation coefficient; S55: After each training round, aggregate the clipped gradients: , , in, yes The i-th row represents the calculations of user u. The gradient; Indicates the calculation by user u The gradient.

6. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1 is characterized in that: in step S6, S61: For the gradient obtained in step 5 Adding a mean of 0 and a variance of Gaussian noise perturbation get : ; S62: Update using the perturbed gradient. : , in, It is the learning rate.

7. The recommendation method based on personalized differential privacy and gradient perturbation according to claim 1, characterized in that: In step S7, the final project latent factor matrix will be generated. Distributed to each user, user Calculate the predicted value on its device Unobserved interactions are sorted in descending order based on predicted values, and finally the top ones are selected. Recommend a project to users .