Federal recommendation method based on generative adversarial network and social graph attention network
By employing a federated recommendation method based on generative adversarial networks and social graph attention networks, this paper addresses the issues of low model accuracy and privacy leakage caused by noise from untrusted servers in federated recommendation, thereby improving recommendation accuracy and security while protecting user privacy.
Patent Information
- Application Number
- CN202210750734.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2042-06-28
AI Technical Summary
Existing federated recommendation methods suffer from poor model accuracy and pose privacy risks due to the introduction of noise from untrusted servers.
We employ a federated recommendation method combining generative adversarial networks and social graph attention networks. Through local updates, embedding layers, adversarial network generator scoring, homomorphic encryption, and global model gradient aggregation, we protect user privacy and improve recommendation accuracy.
While protecting user privacy, it effectively solves the problem of low model accuracy caused by excessive noise introduced by pseudo-interaction strategies, improves the accuracy of recommendation systems, and eradicates the security problem of high-order interaction information.
Smart Images

Figure CN115238172B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to a federated recommendation method based on a generative adversarial network and a social graph attention network. BACKGROUND
[0002] With the rapid development of mobile Internet, there are more and more platforms providing services through the Internet, and the types of services provided are also increasing. The explosive growth of online content and services provides users with a large number of choices. In order to better provide services for users and make more profits, more and more service platforms use personalized recommendation technology to help users find what they like faster.
[0003] A recommendation system is a technical means for finding information of interest to a user from a large amount of information when the user's demand is not clear. The recommendation system combines user information, item information and user past behavior on items, and uses machine learning technology to build a user interest model to provide accurate personalized recommendations for users.
[0004] In recent years, graph neural networks have been widely concerned because they can better capture high-order interaction information between users and items and improve recommendation accuracy. However, existing graph neural network-based recommendation methods usually need to store the entire user-item graph centrally to complete the training of the graph neural network model and the embedding representation of users and items, which means that there is a risk of privacy leakage in the centralized storage of user data.
[0005] In view of the privacy problem of the current federated graph neural network, a federated recommendation method is proposed, which protects the local gradient trained by the federated sub-graph neural network by using local differential privacy technology before uploading to the central server, and extracts some pseudo-interaction items and real interaction items for mixing to reduce the probability of obtaining real interaction item information of users as much as possible. However, the above method usually introduces too much untrusted server noise, resulting in poor model accuracy. SUMMARY
[0006] The present application aims to provide a federated recommendation method based on a generative adversarial network and a social graph attention network, which aims to solve the problem that the existing federated recommendation method introduces untrusted server noise, resulting in poor model accuracy.
[0007] To achieve the above-mentioned purpose, the present application provides a federated recommendation method based on a generative adversarial network and a social graph attention network, comprising the following steps:
[0008] S1 locally update each local client to obtain a target client;
[0009] S2 the target client passes the target user and the interaction item through an embedding layer to obtain item preference information;
[0010] S3 the target client uses an adversarial network generator to score the interaction item based on the item preference to obtain an interaction score sample;
[0011] S4 a loss function value is calculated using the interaction score sample and the initial user interaction item true score of the target client;
[0012] S5 the loss function value is used to derive local model gradients and embedding gradients of a social graph attention network, and then homomorphic encryption is performed to obtain two encrypted gradients;
[0013] S6 the two encrypted gradients are aggregated to obtain global model gradients;
[0014] S7 the global model gradients are decrypted and distributed to the target client;
[0015] S8 the target client updates the local social graph attention network based on the decrypted global model gradients;
[0016] S9 steps S2 to S8 are repeated until the social graph attention network converges to a preset degree, and a final prediction result is obtained.
[0017] Wherein, the specific way of updating each local client locally to obtain a target client is:
[0018] S11 the gradients of all local clients are aggregated to obtain aggregated gradients;
[0019] S12 the aggregated gradients are distributed to each local client for local update to obtain a target client.
[0020] Wherein, the specific way of the target client using an adversarial network generator to score the interaction item based on the item preference to obtain an interaction score sample is:
[0021] S31 the target client filters the target user to obtain a social neighbor user;
[0022] S32 the target user and the social neighbor user are input into an embedding layer to obtain a relationship closeness;
[0023] S33 the interaction item is scored based on the item preference information and the relationship closeness using an attention mechanism to obtain a predicted score;
[0024] S34 the predicted score and random noise are input into an adversarial network generator to obtain an interaction score sample.
[0025] The specific manner in which the target user and the social neighbor user are input into the embedding layer to obtain the relationship closeness degree is that:
[0026] The relationship attention mechanism is used to aggregate the preferences of the target user and the social neighbor user after the embedding layer to obtain the relationship closeness degree.
[0027] The specific manner in which the loss function value is used to derive the local model gradient and the embedding gradient of the social graph attention network and then homomorphic encryption is performed to obtain two encrypted gradients is that:
[0028] S51 derives the local model gradient and the embedding gradient of the social graph attention network using the loss function value;
[0029] S52 respectively homomorphic encrypts the local model gradient and the embedding gradient to obtain two encrypted gradients.
[0030] A federated recommendation method based on a generative adversarial network and a social graph attention network is provided, which obtains a target client by performing local updating on each local client; the target client inputs a target user and an interactive item into an embedding layer to obtain item preference information; the target client uses an adversarial network generator to score the interactive item based on the item preference to obtain an interactive score sample; a loss function value is calculated using the interactive score sample and an initial user interactive item true score of the target client; after the loss function value is used to derive the local model gradient and the embedding gradient of the social graph attention network, homomorphic encryption is performed to obtain two encrypted gradients; the two encrypted gradients are aggregated to obtain a global model gradient; the global model gradient is decrypted and distributed to the target client; the target client updates the local social graph attention network based on the decrypted global model gradient and reacquires the item preference information until the social graph attention network converges to a preset degree to obtain a final prediction result. The social graph attention network and the generative adversarial network introduced in the application improve the recommendation accuracy and protect the user's privacy data to a certain extent. The federated learning is introduced into the model training of the social graph attention network, and the representation of user-item interaction data and user social relationship aggregation is always saved in the local client. The homomorphic encryption method of the gradient improves the phenomenon that the existing federated graph neural network based on local differential privacy usually introduces too much untrusted server noise, resulting in poor model accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0032] Figure 1 is a flow chart of a federated recommendation method based on a generative adversarial network and a social graph attention network provided by the present application.
[0033] Figure 2 is a model diagram of a federated recommendation method based on a generative adversarial network and a social graph attention network provided by the present application.
[0034] Figure 3 is a schematic diagram of federated sub-social graph aggregating user preference information using relationship attention mechanism.
[0035] Figure 4 is a process diagram of the generative adversarial network training the aggregated user preference information.
[0036] Figure 5 is a process diagram of Intel SGX and data provider of federated sub-graph establishing a secure transmission channel.
[0037] Figure 6 is a schematic diagram of homomorphic encryption of the average gradient of the federated sub-graph and uploading to the server for aggregation.
[0038] Figure 7 is a training flow chart of a federated recommendation method based on a generative adversarial network and a social graph attention network provided by the present application. DETAILED DESCRIPTION
[0039] The embodiments of the present application will be described in detail below, examples of which are shown in the drawings, wherein the same or similar reference signs represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are intended to explain the present application, and cannot be understood as a limitation of the present application.
[0040] Please refer to Figures 1 to 7 , the present application provides a federated recommendation method based on a generative adversarial network and a social graph attention network, comprising the following steps:
[0041] S1 locally updating each local client to obtain a target client;
[0042] The specific manner is:
[0043] S11 aggregates the gradients of all local clients to obtain aggregated gradients;
[0044] Specifically, the central server (Intel SGX server) is responsible for maintaining the global user interaction items and user social relationship aggregated representation, and aggregating the gradients trained by each local client.
[0045] S12 distributes the aggregated gradients to each local client for local update to obtain a target client.
[0046] Specifically, the central server distributes the aggregated gradients to each local client participating in the training of the federated social graph attention network for local update.
[0047] S2 the target client embeds the target user and the interaction items through an embedding layer to obtain item preference information;
[0048] Specifically, each client embeds the target user and the interaction items in the local subgraph through an embedding layer to obtain the embedding of the interaction items as the input of the graph attention network recommendation model training, and obtains the preference information of the user for the items.
[0049] The aggregated user preference information is used as the input data of the generative adversarial network, and the finally output result data which is not original true data but very similar to the original data features can guarantee the training effect and effectively resist malicious reasoning attacks of attackers based on the output result.
[0050] S3 the target client scores the interaction items based on the item preference using the adversarial network generator to obtain interaction score samples;
[0051] The specific way is:
[0052] S31 the target client filters the target user to obtain a social neighbor user;
[0053] S32 inputs the target user and the social neighbor user into an embedding layer to obtain a relationship closeness;
[0054] Specifically, each client uses a relationship attention mechanism to aggregate the preference of the neighbor user (social neighbor user) having a social relationship with the target user in step S31 through an embedding layer in the local subgraph to obtain the embedding of the target user and the neighbor user as the input of the graph attention network recommendation model training, and obtain the closeness (relationship closeness) of the target user and other users (social) relationship.
[0055] S33 scores the interaction items based on the item preference information and the relationship closeness using an attention mechanism to obtain a predicted score;
[0056] Specifically, the target user's preference information of the items, and the neighbor users having social relationship with the target user, obtain the predicted scores of the items based on the preference information of the neighbor users by using a relationship attention mechanism.
[0057] S34 inputs the predicted scores and random noise into a generative adversarial network generator to obtain an interaction score sample.
[0058] Specifically, the predicted scores and random noise Z are input into a generative adversarial network generator G, and the generator G generates an interaction score sample (pseudo score). Meanwhile, a discriminator gives a binary judgment of true or false according to the input interaction score sample.
[0059] S4 calculates a loss function value by using the interaction score sample and the initial user interaction item real scores of the target client;
[0060] S5 derives local model gradients and embedding gradients of a social graph attention network by using the loss function value, and then performs homomorphic encryption to obtain two encrypted gradients.
[0061] The specific method is as follows:
[0062] S51 derives local model gradients and embedding gradients of a social graph attention network by using the loss function value.
[0063] Specifically, the local model gradients and the embedding gradients are derived from the obtained loss function value.
[0064] S52 performs homomorphic encryption on the local model gradients and the embedding gradients respectively to obtain two encrypted gradients.
[0065] Specifically, in order to prevent privacy problems caused by side channel attacks on Intel SGX, homomorphic encryption is introduced, so that even if Intel SGX is attacked, an adversary can only access ciphertext and cannot access plaintext. After the local training of each client in an epoch is completed, the gradients are then homomorphically encrypted.
[0066] S6 aggregates the two encrypted gradients to obtain a global model gradient.
[0067] Specifically, the homomorphically encrypted gradients are uploaded to Intel SGX for aggregation, and then a global model gradient is obtained.
[0068] S7 decrypts the global model gradient and distributes it to the target client.
[0069] S8 updates the local social graph attention network of the target client based on the decrypted global model gradient.
[0070] S9 repeats steps S2 to S8 until the social graph attention network converges to a preset degree, obtaining a final prediction result.
[0071] We effectively solve the problem of low model accuracy caused by excessive noise introduced by pseudo interaction strategy while protecting user privacy, and fundamentally solve the security problem of introducing unreliable third-party servers when modeling high-order interaction information of GNN.
[0072] Implementation case:
[0073] The following case takes a central server and two clients as an example to further illustrate the present application, and the specific implementation steps are as follows.
[0074] Step 1: In each federated subgraph, first obtain the items (t1, t2, t3, t4) that the user u1 initially interacts with, and pass them through the neural network embedding layer to obtain their corresponding embedding representations e tn t1 t2 t3 t4 as input to the graph attention network model.
[0075] Step 2: The users (u2, u3, u4) who have direct social relationships with user u1 are passed through the neural network embedding layer to obtain their corresponding embedding representations e ui u1 u2 u3 u4 as input to the graph attention network model.
[0076] Step 3: The embedding representations obtained in step 1 are input into the local graph attention network model, and after the model is trained, the hidden representation of user preference information is obtained i is the number of the target user, and n is the number of items that the target user has interacted with.
[0077] where the hidden representation of user preference information Here, sigma represents a nonlinear activation function, and C(i) is the item that u i interacts with, alpha in represents the attention weight of item tn to user u i , and x in is the rating representation of user u i to item tn, which is represented as
[0078] Here, g v () represents a multilayer perceptron, e ui is the embedding representation of the target user and its social relationship neighbor users, and e tn Embedding representation of the target user interacting with the item.
[0079] Step 4: Take the embedding representation obtained in step 2 as the input of the local graph attention network model, and after the model is trained, obtain the closeness degree of the target user to its neighbor users (social) relationship i is the number of the target user, and n is the number of the neighbor user having a social relationship with the target user.
[0080] wherein the closeness degree of the target user to its neighbor users (social) relationship w1 and w2 are the weight vectors of the attention network, and b1 and b2 are the bias terms.
[0081] Step 5: On the basis of step 3, step 4 will obtain the hidden representation of the social relationship user preference information After passing through a rating predictor, a predicted score is obtained
[0082] wherein the hidden representation of the social relationship user preference information k is the neighbor user having a social relationship with the target user, n is the number of the item interacted by the target user, o here represents the user um, and N(i) represents the set of users having a social relationship with u i .
[0083] Step 6: Take the predicted score of step 5 and random noise Z as the input of the generative adversarial network generator G, and G will generate an interaction score sample (pseudo score) At the same time, the discriminator gives a binary judgment of true or false according to the input interaction score sample and the real score of the user u1 on the interactive item.
[0084] Step 7: Use the real score of the federated subgraph user u1 on the interactive item and the interaction score sample (pseudo score) Calculate the value of the loss function. For user ui, the loss function (where k is a user having a social relationship with user ui)
[0085] Step 8: Use the value obtained by the loss function Derive the model gradient and embedding gradient, respectively represented as and
[0086] Step 9: In the Intel SGX initialization phase, the server will open an enclave program area on Intel SGX. For example Figure 5As shown, the data provider of each federal subgraph will verify the legitimacy of the enclave program area, the server establishes a key exchange protocol with each data provider, and agrees on the public key pk. This establishes a secure transmission channel between the enclave and each data provider of the federal subgraph, and all subsequent data will be transmitted through this channel.
[0087] Step 10: After ensuring that the enclave program area is running legitimately on Intel SGX, the Paillier encryption system generates a corresponding public key pk and private key sk for the data of each federal k subgraph. By deploying Intel SGX on the server, the server acts as a trusted third party, and compared with the LDP model, it introduces less noise while achieving the same privacy protection effect.
[0088] Step 11: Homomorphically encrypt the average gradient of each federal subgraph using the public key pk generated by the Paillier encryption system, as shown in Figure 6 After the average gradient is encrypted, it is as follows: Then it is uploaded to the enclave program area opened on Intel SGX on the server for aggregation, to obtain the encrypted average aggregated gradient. Note that here the is the average gradient of the federal subgraph, and Q represents the number of federal subgraphs participating in aggregation,
[0089] Step 12: Finally, Intel SGX generates a verification identifier σs after the enclave program is executed, and returns it together with the ciphertext of the aggregated gradient to each federal subgraph participating in aggregation.
[0090] Step 13: After receiving the verification identifier σs, each federal subgraph participating in aggregation will verify its legitimacy to ensure that Intel SGX normally completes the operation of the aggregated gradient. Secondly, use its private key sk to decrypt the aggregated gradient ciphertext to obtain the global gradient to update the training of each federal subgraph model. This process is iteratively executed until the entire model converges, indicating that the training of the entire framework combining federated learning, generative adversarial network and social graph attention network is completed, which improves the accuracy of recommendation to some extent, and also effectively protects the security of user privacy.
[0091] The innovations of the present application include the following aspects:
[0092] A federated recommendation method based on a generative adversarial network and a social graph attention network is proposed.
[0093] The federated learning is applied to the recommendation system based on the social graph attention network, so that the user interaction data completes the training of the local sub-social graph attention network model without leaving the local device.
[0094] The generative adversarial network is introduced into the federated recommendation, the aggregated user preference information is used as the input data of the generative adversarial network, and finally, the output result data which is not original true data but is very similar to the original data features can guarantee the training effect and effectively resist malicious reasoning attacks of attackers based on the output result.
[0095] The Intel SGX is applied to the federated recommendation method of the generative adversarial network and the social graph attention network. By using the Intel SGX, compared with the LDP-based graph neural network recommendation method, the method introduces less noise, and the model performance is also improved.
[0096] The federated learning framework is integrated, the generative adversarial network and the social graph attention network are combined to improve the recommendation accuracy and protect the security of user privacy. First, in each local client, the social graph attention network and the generative adversarial network are introduced into the federated recommendation, for the target user and the other user with similar preferences existing social relationship, the user preference is aggregated according to the relationship attention mechanism, and the quality of the recommendation result is improved through the fusion of multi-dimensional data; secondly, the generative adversarial network is used to train the generated data which is very similar to the user data features, so that the security of the user data can be effectively protected; it should be particularly noted that when the federated sub-social graph attention network training model is trained, the representation of the user interaction item data and the user social relationship aggregation is always saved on each federated sub-graph. Then, in order to guarantee the security of the gradient in the transmission process, the trained gradient is first encrypted and then uploaded to the central server, the central server is responsible for aggregating the gradient uploaded by each local client and obtaining the global model gradient, and in the whole process, the privacy security of the user can be effectively protected.
[0097] The above only discloses a preferred embodiment of the federated recommendation method based on the generative adversarial network and the social graph attention network, of course, cannot limit the scope of the rights of the application, and those skilled in the art can understand that all or part of the processes of the above-mentioned embodiments are implemented, and equivalent changes made according to the claims of the application still belong to the scope covered by the application.
Claims
1. A federated recommendation method based on a generative adversarial network and a social graph attention network, characterized in that, The method comprises the following steps: S1, locally updating each local client to obtain a target client; S2, inputting the target user and the interaction item into an embedding layer by the target client to obtain item preference information; S3, scoring the interaction item based on the item preference by the target client using a generative adversarial network to obtain an interaction score sample; S4, calculating a loss function value by using the interaction score sample and the initial user interaction item true score of the target client; S5, performing homomorphic encryption on the local model gradient and the embedding gradient of the social graph attention network by using the loss function value to obtain two encrypted gradients; S6, aggregating the two encrypted gradients to obtain a global model gradient; S7, distributing the decrypted global model gradient to the target client; S8, updating the local social graph attention network based on the decrypted global model gradient by the target client; S9, repeating steps S2 to S8 until the social graph attention network converges to a preset degree to obtain a final prediction result.
2. The federated recommendation method based on the generative adversarial network and the social graph attention network according to claim 1, wherein a specific way of locally updating each local client to obtain a target client is: S11, aggregating the gradients of all local clients to obtain an aggregated gradient; S12, distributing the aggregated gradient to each local client for local updating to obtain a target client.
3. The federated recommendation method based on the generative adversarial network and the social graph attention network according to claim 2, wherein a specific way of scoring the interaction item based on the item preference by the target client using a generative adversarial network to obtain an interaction score sample is: S31, screening the target user by the target client to obtain a social neighbor user; S32, inputting the target user and the social neighbor user into an embedding layer to obtain a relationship closeness; S33, scoring the interaction item based on the item preference information and the relationship closeness using an attention mechanism to obtain a predicted score; S34, inputting the predicted score and random noise into a generative adversarial network to obtain an interaction score sample.
4. The federated recommendation method based on the generative adversarial network and the social graph attention network according to claim 3, wherein a specific way of inputting the target user and the social neighbor user into an embedding layer to obtain a relationship closeness is: performing preference aggregation on the target user and the social neighbor user through the embedding layer using a relationship attention mechanism to obtain a relationship closeness.
5. The federated recommendation method based on the generative adversarial network and the social graph attention network according to claim 4, wherein a specific way of performing homomorphic encryption on the local model gradient and the embedding gradient of the social graph attention network by using the loss function value to obtain two encrypted gradients is: S51, deriving the local model gradient and the embedding gradient of the social graph attention network by using the loss function value. S52 homomorphically encrypts the local model gradient and the embedding gradient respectively to obtain two encrypted gradients.