Federated Bayesian personalized ranking recommendation method and system based on Multi-Krum
By combining federated learning with Bayesian personalized sorting in the recommendation system and adopting the Multi-Krum aggregation method, the problems of user privacy leakage and insufficient system robustness are solved, and effective protection of user privacy and high system security are achieved.
Patent Information
- Application Number
- CN202210492179.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-07
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-05-07
AI Technical Summary
Existing recommendation systems cannot take into account the protection of user privacy and the robustness and security of the system. They are particularly prone to leaking user sensitive information in an implicit feedback environment, and there is a risk of the Byzantine threat model.
Combining federated learning and Bayesian personalized sorting, the Multi-Krum aggregation method is adopted to train models locally on the user side and optimize models on the central server side to effectively protect user privacy and reduce the impact of malicious gradients, improving the robustness and security of the model.
It realizes effective protection of user privacy in the recommendation system, improves the robustness and security of the system, avoids the leakage of user sensitive information, and resists malicious gradient attacks.
Smart Images

Figure CN115033781B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of recommendation systems and federated learning, and in particular to a federated Bayesian personalized ranking recommendation method and system based on Multi-Krum. Background Art
[0002] With the development of the Internet, the scale of data on the Internet has exploded. Recommendation systems have gradually become the infrastructure of the Internet and are widely used in various scenarios.
[0003] The recommendation system abstracts the user's preference for an item into a user-item matrix. The element in the i-th row and j-th column of the matrix represents the preference of the i-th user for the j-th item. If there has been an interaction between the user and the item, the user's preference for the item is directly expressed based on the interaction record between the user and the item; if there has been no interaction between the user and the item, the user's preference for the item is expressed based on the interaction score between the user and the item estimated by the recommendation system model.
[0004] The task of traditional recommendation systems is to use the known values in the user-item matrix (i.e., the interaction records between users and items that have been generated) to estimate the remaining unknown values (i.e., the estimated interaction scores between users and items that have not occurred). After completing the entire user-item matrix, the recommended items to the user are determined based on the values of the estimated interaction scores between users and items in the matrix.
[0005] The interaction records between users and projects can generally be divided into two categories:
[0006] (1) Explicit feedback. Interaction records can provide explicit feedback on the user’s preference for an item. For example, the ratings given to movies by users on an online movie viewing platform can directly reflect the user’s preference for the item.
[0007] (2) Implicit feedback. Interaction records can only indicate whether there has been an interaction between the user and the item, but cannot explicitly provide information about the user’s preference for the item. For example, on a video website, a user clicks on a piece of news or watches a short video.
[0008] In implicit feedback, the interaction between the user and the item only means that the user is likely to like the item (for example, the user may interact with an item that he is not interested in due to an accidental click), and the lack of interaction between the user and the item does not mean that the user does not like the item (the user may not have found the item that he is interested in yet). In summary, implicit feedback contains noise and only has positive feedback, which is more difficult to handle than explicit feedback.
[0009] Bayesian Personalized Ranking (BPR) is a commonly used optimization method for recommendation system models. It can use the "paired comparison" feature between items to eliminate noise in training data and achieve better model training results. However, in the application scenario of the recommendation system, if Bayesian Personalized Ranking is directly applied, the interaction information between users and items will inevitably be implied in the gradient, causing users to worry about privacy issues. Whether in the stage of uploading user-side interaction records or in the stage of storing user interaction records on the server side, there is a risk of leakage of user sensitive information.
[0010] Federated learning is a new machine learning paradigm that performs model training locally on each client and optimizes the model on the server. It has the advantage of protecting the privacy and security of user data. In each round of training in federated learning, the central server randomly selects several clients to participate in the training and shares the model parameters with these clients. Each client participating in the training trains the model based on the data stored locally and uploads the calculated gradients to the central server. At the end of each round of training, the central server aggregates the gradients uploaded by each client participating in the training and updates the model parameters accordingly. Under the paradigm of federated learning, the model is shared with each client by the central server, and the data of each client is stored locally by the client, not shared with the central server or other clients. Since there is no need to upload data to the central server, federated learning can minimize data leakage and protect user privacy. It is more direct and effective than related algorithms such as data desensitization.
[0011] In addition, with the development of federated learning, the security of distributed learning has attracted more and more attention, among which the most important is the Byzantine threat model. Traditional distributed machine learning assumes that each computing node is reliable. However, some computing nodes may send erroneous malicious gradients to the server due to data corruption, communication errors or malicious attacks, resulting in the failure of model collaborative training. In this application scenario, if the attacker controls some user terminals to upload malicious gradients, it will affect the training of the model and affect the recommendation results of the final model.
[0012] It can be seen that the existing recommendation system cannot take into account the protection of user privacy as well as the robustness and security of the system. It is very necessary to study a recommendation system that can effectively protect user privacy, is sufficiently secure and robust, and does not excessively degrade the recommendation effect. Summary of the invention
[0013] In view of the defects of the existing recommendation system that cannot effectively protect user privacy and the lack of robustness and security, this paper proposes a federated Bayesian personalized ranking recommendation method and system based on Multi-Krum. By combining federated learning with Bayesian personalized ranking, user privacy in the recommendation system is effectively protected. The Multi-Krum aggregation method is used in federated learning to effectively reduce the impact of malicious gradients and improve the robustness and security of the model.
[0014] In order to achieve the above object, the present invention adopts the following technical solution:
[0015] A federated Bayesian personalized ranking recommendation method based on Multi-Krum includes the following steps:
[0016] Step 1: Randomly select non-interacted items on each user side, which are equal to the number of items that the user has interacted with, and construct a partial order relation triple;
[0017] Step 2: Initialize user model parameters on each user side and initialize project model parameters on the central server side;
[0018] Step 3: The central server randomly selects several user terminals to participate in the training. The local user terminal uses all the partial order relationship triples constructed in step 1 to calculate the local loss function value of the recommendation system model, and the recommendation system model is composed of a user model and a project model. The gradient of the local user model parameter and the gradient of the project model parameter are generated according to the local loss function value. The gradient of the local user model parameter is used to update the local user model parameter, and the project model parameter is used to be transmitted back to the central server. The Multi-Krum aggregation method is used to update the project model parameter.
[0019] Step 4: Repeat step 3 until the recommendation system model converges;
[0020] Step 5: When recommending items on the local user side, the recommendation degree of each item for the local user is calculated based on the inner product of the local user model parameters and the item model parameters, and the top-ranked items are selected as the recommendation results.
[0021] A federated Bayesian personalized ranking recommendation system based on Multi-Krum is used to implement the above-mentioned federated Bayesian personalized ranking recommendation method based on Multi-Krum.
[0022] The present invention combines Bayesian personalized ranking with federated learning and introduces the aggregation method of Multi-Krum, and proposes a federated Bayesian personalized ranking recommendation method and system based on Multi-Krum, which has the advantages of protecting user privacy and Byzantine robustness while achieving a relatively good recommendation effect. Compared with the prior art, the beneficial effects of the present invention are as follows:
[0023] (1) The present invention combines federated learning with Bayesian personalized ranking, so that user privacy can be effectively protected while completing the recommendation task. During the local training process, each round of iterative training uses the same partially ordered triples, and the gradients uploaded to the central server each time are only related to a fixed number of projects, which overcomes the problem that the frequency of projects that the user has interacted with on the central server is much greater than that of projects that have not been interacted with. The central server can no longer judge which projects the user has interacted with based on the frequency of non-zero gradients related to each project in the gradients uploaded by the user, further protecting user privacy.
[0024] (2) The present invention adopts the Multi-Krum aggregation method in the process of federated learning. In each round of central server aggregation, a valid gradient set is screened out from the collected feedback gradient set, and the average value of all gradients in the valid gradient set is taken as the aggregated gradient. The project model parameters are updated, so that the recommendation system has Byzantine robustness, effectively resists the attack of malicious gradients, and ensures the security of the federated recommendation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Flowchart of recommendation system model training optimized for Bayesian personalized ranking;
[0026] Figure 2 Recommend query flow chart to the user end;
[0027] Figure 3 This is the Multi-Krum gradient polymerization flow chart. DETAILED DESCRIPTION
[0028] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be pointed out that the embodiments described below are intended to facilitate the understanding of the present invention and do not have any limiting effect on the present invention.
[0029] Different from the Bayesian personalized ranking used in traditional recommendation systems, this paper combines Federated Learning with Bayesian personalized ranking and proposes a Multi-Krum-based federated Bayesian personalized ranking recommendation system model. The system is divided into user model, project model, data module, training module and query module. Figure 1As shown in the figure, the data module is used to generate the partial order relation triple of the current user, and the complete recommendation system model composed of the user model and the project model is passed in. The recommendation system model is trained using the training module located at each user end. The parameter gradient of the user model is stored locally, and the parameter gradient of the project model is sent back to the server end. The server end is used as shown in the figure. Figure 3 The Multi-Krum aggregation algorithm shown in the figure performs parameter aggregation. When the user performs a recommendation query, the following is used: Figure 2 The recommendation query process shown is to estimate the user's preference score for each item and output a recommended list of items with the highest scores.
[0030] The optimization method of Bayesian personalized ranking cannot be directly applied to federated learning scenarios. When using Bayesian personalized ranking to optimize the recommendation system model, the process is usually: for each round of training, a certain number of users are randomly selected to participate in the training. Each user terminal participating in the training randomly selects items equal to the number of items it has interacted with from the items it has not interacted with, and makes the interacted items correspond to these items one by one, and together with the user itself, form several partially ordered triples. In this round of training, the partially ordered relationship triples generated by each user participating in the training will be used as sampled training data for recommendation system model training. Since the number of items in most recommendation systems is very large, the number of items that users have interacted with is often much less than the number of items that have not been interacted with. This means that for each user, the items that they have interacted with are more likely to be randomly selected as positive samples in the generated partial order relationship, while the items that they have not interacted with are more difficult to be randomly selected as negative samples in the generated partial order relationship.
[0031] The frequency of items that users have interacted with in the generated partial order relation is much higher than that of items that they have not interacted with. In the scenario of federated learning, the frequency of non-zero gradients related to items that the user has interacted with in the gradients uploaded by the user is much higher than that of gradients related to items that the user has not interacted with. On the central server side, the projects that the user has interacted with can be simply determined based on the frequency of non-zero gradients related to each item in the gradients uploaded by the user, and the user's privacy cannot be effectively protected.
[0032] In order to apply the optimization method of Bayesian personalized sorting to the federated learning scenario without losing the characteristic of federated learning to protect user privacy, the present invention improves the process of Bayesian personalized sorting optimization recommendation system model. Before the start of the first round of training, each user randomly selects uninteracted projects equal to the number of projects with which he has interacted, and makes the projects with which he has interacted correspond to the randomly selected projects with which he has interacted one by one, and together with the user himself, they form several partially ordered relationship triples. In the subsequent rounds of training, each user participating in the training uses the partially ordered relationship triples generated before the start of the training as sampled training data for recommendation system model training, and no longer regenerates the partially ordered relationship triples in each round of training. This means that the gradients uploaded by each user are only related to a fixed number of projects, and the central server can no longer judge which projects the user has interacted with based on the frequency of non-zero gradients related to each project in the gradients uploaded by the user. For example, x partially ordered relation triplets are generated. Each time the user is selected to participate in training, the gradients related to these 2x items (x interacted items and x non-interacted items) in the uploaded gradients are non-zero. The central server only knows that the items the user has interacted with are among the 2x items, but does not know which of the 2x items the user has interacted with and which the user has not interacted with. This protects the user's privacy and solves the problem that the frequency of items the user has interacted with is much greater than that of items that have not been interacted with.
[0033] In the federated Bayesian personalized ranking proposed in the present invention, unlike the common federated recommendation algorithm that uses average aggregation (FedAvg), the present invention selects to use the Multi-Krum aggregation method based on the characteristics of the recommendation task. The Multi-Krum aggregation method can effectively improve the security of the recommendation system, making the method of the present invention Byzantine-robust.
[0034] First, the Krum aggregation method is explained, that is, the gradient with the smallest sum of distances to other gradients is selected as the aggregate gradient for model update. The Multi-Krum aggregation method is improved on the basis of Krum. By performing the gradient selection process in multiple Krum aggregations, the gradient is removed from the original gradient set after each selection and added to the selection set. After several iterations, the average of the gradients in the selection set is calculated as the final aggregate gradient to update the model parameters. Through Multi-Krum aggregation, the influence of Byzantine gradients can be effectively reduced and the robustness of the model can be improved.
[0035] In a specific implementation of the present invention, Figure 1 As shown in FIG. 1 , a federated Bayesian personalized ranking recommendation method based on Multi-Krum is provided, which includes the following steps:
[0036] (1) On each user side, randomly select non-interacted items that are equal to the number of items that the user has interacted with, and associate the interacted items with the non-interacted items one-to-one, forming several partially ordered relation triples together with the user itself.
[0037] In this embodiment, a partial order relationship triple is generated based on the interaction records between users and projects. Specifically, if user u has interacted with project i but not with project j, it can be roughly considered that user u likes project i more than project j, and the triple (u, i, j) is used to represent this partial order relationship. For example, on an online movie viewing platform, if user u has watched movie i but not movie j, it can be roughly considered that user u likes movie i more than movie j. Therefore, based on the interaction records between each user and each project, it is possible to obtain which projects each user has interacted with and which projects have not yet interacted with, and further generate several partial order relationship triples based on this to form a set D s , and use it as the training set used in subsequent training.
[0038] Among the partially ordered triples stored in the local user end, each round of iterative training uses the same partially ordered triples, and the gradients uploaded to the central server each time are only related to a fixed number of items.
[0039] (2) Initialize user model parameters on each user side and initialize project model parameters on the central server side. The user model parameters are local user feature vectors that the user side needs to maintain, with a dimension of 1×k. The project model parameters are project feature matrices composed of project feature vectors of all projects that the central server side needs to maintain, with a dimension of n×k, where n is the number of projects.
[0040] (3) The central server randomly selects several users to participate in the training:
[0041] (3.1) The central server sends the project model parameters to each user participating in the training.
[0042] (3.2) Each user terminal participating in the training calculates the loss function value of the model based on the partially ordered relation triples generated locally, the local user model parameters, and the project model parameters sent by the central server.
[0043] In this embodiment, the loss function is expressed as:
[0044]
[0045] Among them, λ θ is the regularization coefficient, σ is the sigmoid function, and θ represents the parameters of the recommendation system model. It represents the degree of preference of user u for item positive sample i estimated by the recommendation system model, represents the degree of preference of user u for item negative sample j estimated by the recommendation system model, ‖.‖ 2 represents the norm, (u,i,j) represents the value belonging to the training set D s A partially ordered relation triple in .
[0046] (3.3) Each user terminal participating in the training calculates the gradient of the user model parameters and the gradient of the project model parameters based on the loss function value obtained above.
[0047] (3.4) Each user terminal participating in the training updates the local user model parameters according to the gradient of the local user model parameters, and uploads the calculated gradient of the project model parameters to the central server.
[0048] (3.5) The central server collects the gradients of the project model parameters uploaded by all users participating in the training, and uses the Multi-Krum aggregation method to update the project model parameters.
[0049] In this embodiment, Figure 3 As shown in the figure, the process of updating project model parameters using the Multi-Krum aggregation method is as follows:
[0050] (3.5.1) Calculate the sum of the normalized distances between each gradient in the returned gradient set and other gradients;
[0051] (3.5.2) Select the gradient with the smallest paradigm distance and add it to the valid gradient set;
[0052] (3.5.3) Remove the selected gradient from the returned gradient set;
[0053] (3.5.4) Repeat steps (3.5.1) to (3.5.3) several times to obtain a valid gradient set;
[0054] (3.5.5) Take the average of all gradients in the valid gradient set as the aggregate gradient and update the project model parameters.
[0055] The Multi-Krum aggregation method adopted by the present invention can effectively reduce the impact of malicious gradients that deviate from the mainstream on the model, making the model Byzantine robust.
[0056] (4) Repeat step (3) until the model converges. When making recommendations to users, Figure 2 As shown, the user end calculates the recommendation degree of each project for the user based on the inner product of the local user model parameters and the project model parameters, and selects the top-ranked projects to recommend to the user.
[0057] Corresponding to the aforementioned embodiment of a federated Bayesian personalized ranking recommendation method based on Multi-Krum, the present application also provides an embodiment of a federated Bayesian personalized ranking recommendation system based on Multi-Krum, which completes tasks such as data acquisition, local training, and central server parameter update to achieve full automation of the recommendation system.
[0058] The federated Bayesian personalized ranking recommendation system based on Multi-Krum proposed in the present invention includes:
[0059] User model, which is stored in each local user terminal and is used to maintain the local user feature vector;
[0060] The project model is stored on the central server and is used to maintain the project feature vectors of all projects.
[0061] The data module is located on each user terminal and is used to generate a partially ordered relation triple related to the current user based on the items that the current user has interacted with and the items that the current user has not interacted with before training begins.
[0062] The training module is located on each user terminal. It takes the user model parameters of the current user, the latest project model parameters issued by the central server, and the partial order relationship triple set as input, and takes the user model parameter gradient of the current user and the project model parameter gradient of all projects as output. When a certain project does not exist in the partial order relationship triple set of the local user, the gradient output for the project is a 0 vector.
[0063] The query module is located on the central server side. It takes the user model parameters of a certain user and the project model parameters of all projects as input, estimates the user's preference score for each project by calculating the inner product of the user model parameters and the project model parameters, and outputs a recommended list of projects ranked by the highest scores.
[0064] Regarding the system in the above embodiment, the specific manner in which each unit or module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0065] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only schematic, and each module therein may or may not be physically separated. In addition, each functional module in the present invention can be integrated into a processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned integrated modules or units can be implemented in the form of hardware or in the form of software functional units, so as to select some or all of the modules according to actual needs to achieve the purpose of the present application scheme.
[0066] The embodiments described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A federated Bayesian personalized ranking recommendation method based on Multi-Krum, characterized in that: The following steps are involved: Step 1: Randomly select non-interacted items equal to the number of items that the user has interacted with on each user side, and construct a partially ordered relation triple. Specifically, before the first round of training, each user randomly selects non-interacted items equal to the number of items that the user has interacted with, and makes the interacted items and the randomly selected non-interacted items correspond one-to-one, and together with the user itself, form several partially ordered relation triples. Step 2: Initialize user model parameters on each user side and initialize project model parameters on the central server side; the user model parameters are local user feature vectors with a dimension of 1×k, and the project model parameters are project feature matrices composed of project feature vectors of all projects with a dimension of n×k, where n is the number of projects; Step 3: The central server randomly selects several user terminals to participate in the training. The local user terminal uses all the partial order relationship triples constructed in step 1 to calculate the local loss function value of the recommendation system model, and the recommendation system model is composed of a user model and a project model. The gradient of the local user model parameter and the gradient of the project model parameter are generated according to the local loss function value. The gradient of the local user model parameter is used to update the local user model parameter, and the project model parameter is used to be transmitted back to the central server. The Multi-Krum aggregation method is used to update the project model parameter. The step 3 is specifically as follows: (3.1) The central server sends the project model parameters to each user terminal participating in the training; (3.2) Each user terminal participating in the training calculates the loss function value of the model based on the partially ordered relation triples generated locally, the local user model parameters, and the project model parameters sent by the central server. (3.3) Each user terminal participating in the training calculates the gradient of the user model parameters and the gradient of the project model parameters based on the obtained loss function value; (3.4) Each user terminal participating in the training updates the local user model parameters according to the gradient of the local user model parameters, and uploads the calculated gradient of the project model parameters to the central server; (3.5) The central server collects the gradients of the project model parameters uploaded by all participating users to form a return gradient set, and uses the Multi-Krum aggregation method to update the project model parameters; The Multi-Krum aggregation method is used to update the project model parameters, specifically: (3.5.1) Calculate the sum of the normalized distances between each gradient in the returned gradient set and other gradients; (3.5.2) Select the gradient with the smallest paradigm distance and add it to the valid gradient set; (3.5.3) Remove the selected gradient from the returned gradient set; (3.5.4) Repeat steps (3.5.1) to (3.5.3) several times to obtain a valid gradient set; (3.5.5) Take the average of all gradients in the valid gradient set as the aggregate gradient and update the project model parameters; Step 4: Repeat step 3 until the recommendation system model converges; Step 5: When recommending items on the local user side, the recommendation degree of each item for the local user is calculated based on the inner product of the local user model parameters and the item model parameters, and the top-ranked items are selected as the recommendation results.
2. According to claim 1, a federated Bayesian personalized ranking recommendation method based on Multi-Krum is characterized in that: In step 3, the item model parameters transmitted back to the central server in each round are fixed items, and the fixed items include items that the local user has interacted with and an equal number of items that have not been interacted with.
3. A federated Bayesian personalized ranking recommendation system based on Multi-Krum, characterized in that: For implementing the Multi-Krum-based federated Bayesian personalized ranking recommendation method described in claim 1, the recommendation system comprises: A user model, which is located at each local user terminal and is used to maintain a local user feature vector; The project model is located on the central server and is used to maintain the project feature vectors of all projects; The data module is located on each user terminal and is used to generate a partial order relation triple based on the items that the current user has interacted with and the items that have not been interacted with before the first round of training. Specifically, before the first round of training, each user randomly selects the same number of non-interacted items as the items that he has interacted with, and makes the items that he has interacted with correspond to the randomly selected non-interacted items one by one, and together with the user himself, they form a number of partial order relation triples. The training module is located on each user terminal and is used to take the user model parameters of the current user, the latest project model parameters issued by the central server, and the set of partially ordered relation triples as input, and take the user model parameter gradient of the current user and the project model parameter gradient of all projects as output; The specific training process is as follows: The central server sends the project model parameters to each user participating in the training; Each user terminal participating in the training calculates the loss function value of the model based on the partially ordered relation triples generated locally, the local user model parameters, and the project model parameters sent by the central server. Each user terminal participating in the training calculates the gradient of the user model parameters and the gradient of the project model parameters based on the obtained loss function value; Each user terminal participating in the training updates the local user model parameters according to the gradient of the local user model parameters, and uploads the calculated gradient of the project model parameters to the central server; The central server collects the gradients of the project model parameters uploaded by all participating users to form a return gradient set, and uses the Multi-Krum aggregation method to update the project model parameters; The Multi-Krum aggregation method is used to update the project model parameters, specifically: Calculate the sum of the normalized distances between each gradient in the returned gradient set and other gradients; Select the gradient with the smallest paradigm distance and add it to the valid gradient set; Remove the selected gradient from the returned gradient set; Repeat several times to obtain a valid gradient set; Take the average value of all gradients in the valid gradient set as the aggregate gradient and update the project model parameters; The query module is located on the central server side and is used to take the user model parameters to be queried and the project model parameters of all projects as input, calculate the recommendation degree of each project for the local user according to the inner product of the local user model parameters and the project model parameters, and select the top-ranked projects as the recommendation results.
Citation Information
Patent Citations
Strong timing sequence project recommendation method and system based on weighted Bayesian personalized sorting
CN112199589A
Recommendation system shilling attack detection method and device, equipment and storage medium
CN112231570A