Federal graph neural network-based fake review detection model training method, detection method and device
By employing a federated graph neural network training method, utilizing GraphSage network and graph convolutional neural network to aggregate comment features, and introducing attention mechanism and differential privacy technology, the problem of insufficient feature representation capability of fake comment detection model is solved, thereby improving detection accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-07
- Publication Date
- 2026-03-31
AI Technical Summary
Existing fake review detection models have limited feature representation capabilities and low detection accuracy.
A federated graph neural network-based training method is adopted. The features of user nodes and product nodes of the comment node's neighbors are aggregated through the GraphSage network to construct a homogeneous graph. The features are then aggregated using a graph convolutional neural network. An attention mechanism is introduced to fuse features from multiple homogeneous graphs. Differential privacy technology is combined to exchange and aggregate model parameters.
The feature representation of comments has been enhanced, improving the accuracy of fake comment detection, enriching the information in the local dataset, and improving the detection effect.
Smart Images

Figure CN118780347B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fake review detection technology, and in particular to a training method, detection method and device for a fake review detection model based on federated graph neural networks. Background Technology
[0002] Fake review detection determines the likelihood of a review being genuine or fake. Currently, commonly used fake review detection algorithms mainly fall into three categories: those based on language and behavioral features, those based on representation learning, and those based on graph structures. Correspondingly, existing fake review detection technologies include BERT models, DeepWalk, and FedGars.
[0003] In the BERT model, to obtain word vectors and text features that contain semantic information about the text context, the BERT model pre-trains a network model on a large unlabeled dataset, achieving bidirectional connections through a "bidirectional Transformer". However, since different datasets have different sparsity levels, the data preprocessing before model training is time-consuming for the BERT model. At the same time, the domain of the dataset, the wording of the text, and the focus of the comments also have a significant impact on the model's detection performance.
[0004] The core idea of DeepWalk is to combine random walks and Skip-Gram models to learn network node representations. After obtaining the node sequence through random walks, it is input into the Skip-Gram model in the Word2Vec algorithm, and optimized using stochastic gradient descent and backpropagation. The final result is the vector representation of the nodes in the network, which is then applied to downstream fake review detection tasks. However, DeepWalk has limitations in handling complex data relationships and balancing heterogeneous information.
[0005] FedGars first extracts content and behavioral features for each reviewer. Then, it constructs a graph using the relationship between fraudsters and regular users. Next, it uses a two-layer graph convolutional neural network to aggregate features from the neighbors of each review node in the graph. After enhancing its own feature representation, these features are fed into the neural network to train a classifier, which then classifies the review data. However, this algorithm requires information about the graph structure and the feature representations of the nodes during model training. But most datasets contain limited information, which means the model can only use a small amount of information when constructing features for user and item nodes. Summary of the Invention
[0006] In view of this, embodiments of the present invention provide a training method, detection method and device for a fake review detection model based on federated graph neural networks, so as to eliminate or improve one or more defects existing in the prior art and solve the problems of limited feature representation ability and low detection accuracy of existing fake review detection models.
[0007] On one hand, this invention provides a method for training a fake review detection model based on a federated graph neural network, characterized in that the method is executed on each client, and each client contains aligned user entities and product entities, including the following steps:
[0008] Obtain a local dataset containing reviews from multiple users for multiple products; label whether each user's review of the corresponding product in the local dataset is false.
[0009] An initial neural network model is obtained; the initial neural network model is based on a graph neural network, including a GraphSage network and a graph convolutional neural network; the local dataset is input into the initial neural network model, and features are extracted from user nodes, product nodes, and comment nodes to obtain first user features, first product features, and first comment features; the extracted first user features and first product features are exchanged with other clients using differential privacy to enhance feature representation, resulting in second user features and second product features; the GraphSage algorithm is used to aggregate the first comment features with the second user features and second product features corresponding to its neighboring user nodes and neighboring product nodes to obtain aggregated comment features; the local dataset is used to construct a preset number of homogeneous graphs of comment nodes through a preset number of different meta-paths; in each homogeneous graph, the graph convolutional neural network is used to aggregate the features of the comment nodes to obtain second comment features; the second comment features obtained from multiple homogeneous graphs are fused based on an attention mechanism to obtain fused comment features; the aggregated comment features and the fused comment features are concatenated to obtain a final feature vector; the final feature vector of each comment is input into a preset classifier to obtain the prediction result for each comment;
[0010] In one round of training, the initial neural network model is trained using the local dataset, a loss function between the label and the prediction result is constructed, and the parameters of the initial neural network model are iterated using the loss function to obtain the initial detection model;
[0011] The parameters of the initial detection model are uploaded to the central server using differential privacy to generate a shared model. The shared model is obtained by the central server by aggregating the parameters of the initial detection models from each client. The parameters of the shared model are received to update the initial detection model, and the next round of repeated training is performed until the initial detection model meets the preset requirements, thus obtaining the final fake comment detection model.
[0012] In some embodiments of the present invention, the method of exchanging extracted first user features and first product features with other clients using differential privacy also includes:
[0013] Define the first dataset and the second dataset as adjacent datasets, and the first dataset and the second dataset should satisfy:
[0014]
[0015] Wherein, X represents the first dataset; X' represents the second dataset; and x represents a data point in the first dataset X.
[0016] Define a random perturbation algorithm that satisfies differential privacy for the adjacent datasets, and its corresponding query function should satisfy:
[0017] PR[M(X)∈O]≤e' ε Pr[M(X')∈O]+δ;
[0018] Where M(·) represents the random perturbation algorithm; Pr[·] represents the query function; X represents the first dataset; X' represents the second dataset; e ’ ε represents the base of the natural logarithm; O represents the privacy budget; δ represents the query result;
[0019] Based on the above definition, the local gradient L2 norm with the threshold is pruned, and a Laplacian differential privacy mechanism with average noise is applied to protect the privacy of the local dataset. The calculation formula is as follows:
[0020] g i =clip(g i ,δ)+Laplace(0,λ);
[0021] Among them, g i This represents the first user feature and the first product feature that each client needs to exchange; clip(·) represents the clipping function; δ represents the threshold; Laplace(·) represents the Laplace function; λ represents the noise intensity.
[0022] In some embodiments of the present invention, the GraphSage algorithm is used to aggregate the first review feature with the second user feature and the second product feature corresponding to its neighboring user nodes and neighboring product nodes to obtain the aggregated review feature, and the method further includes:
[0023] In the GraphSage network, the aggregated comment features obtained at each layer are calculated as follows:
[0024]
[0025] in, Let represent the aggregated comment features obtained at layer l; W represent the matrix to be trained; e represent the comment node; AGG(·) represents the aggregation function; This represents the first comment feature of layer l-1; This represents the second user characteristic of the neighboring user nodes in layer (l-1). This represents the second product feature of the neighboring product nodes in layer (l-1).
[0026] In some embodiments of the present invention, the original heterogeneous graph of the local dataset is used to construct a homogeneous graph of a preset number of comment nodes through a preset number of different meta-paths, wherein the meta-paths include at least two comments posted by the same user and two comments belonging to the same product.
[0027] In some embodiments of the present invention, in each homogeneous graph, the features of the comment nodes are aggregated using the graph convolutional neural network to obtain a second comment feature, the formula for which the second comment feature is calculated is:
[0028]
[0029] in, Let represent the second comment feature obtained by the nth homogeneous graph at the (l+1)th layer of the graph convolutional neural network; σ(·) represents the activation function; A represents the adjacency matrix of the comments; and Used to normalize the adjacency matrix; W represents the second comment feature obtained from the nth homogeneous image at the l-th layer of the graph convolutional neural network; l This represents the weight matrix of the l-th layer of the graph convolutional neural network.
[0030] In some embodiments of the present invention, a second comment feature is obtained by fusing multiple homogeneous graphs based on an attention mechanism, resulting in a fused comment feature. The attention weight of the comment node under each meta-path is calculated as follows:
[0031]
[0032] Where, αe,n This represents the attention weight of comment node e on metapath n; z n This represents the attention vector along the metapath n; This represents the connection of the feature vectors of comment node e across all metapaths;
[0033] Based on the attention weights, the fused comment features are calculated using the following formula:
[0034]
[0035] Where E represents the fused comment feature; α e,n This represents the attention weight of comment node e under metapath n; This represents the feature vector of comment node e under metapath n.
[0036] In some embodiments of the present invention, a loss function is constructed for the label and the prediction result, and the loss function is calculated as follows:
[0037]
[0038] Where L represents the loss function; k represents the number of comments; Indicates the label; y r,k This indicates the prediction result.
[0039] In some embodiments of the present invention, the central server uses a federated averaging algorithm to perform weighted averaging of the parameters uploaded by each client, and the calculation formula is as follows:
[0040]
[0041] Among them, R t+1 The parameter represents the (t+1)th iteration of the client; m represents the number of clients; R t The parameter w represents the parameter of the client in the t-th iteration. i This represents the weight of client i.
[0042] On the other hand, the present invention provides a method for detecting fake reviews based on federated graph neural networks, characterized in that the method is executed on the client side and includes the following steps:
[0043] Acquire the data to be detected; the data to be detected contains reviews from at least one user for at least one product;
[0044] The data to be detected is input into a fake review detection model obtained by training a fake review detection model based on a federated graph neural network as described in any of the above descriptions, in order to determine whether the corresponding reviews in the data to be detected are fake reviews.
[0045] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods mentioned above.
[0046] The beneficial effects of the present invention are at least as follows:
[0047] This invention provides a training method, detection method, and device for a fake review detection model based on federated graph neural networks. The fake review detection model is designed based on graph neural networks. First, a GraphSage network is used to aggregate the features of user nodes and product nodes, which are neighbors of a review node, to obtain aggregated review features. Then, multiple homogeneous graphs are constructed from heterogeneous graphs in the local dataset by designing different meta-paths. In each homogeneous graph, a graph convolutional neural network is used to aggregate the features of each review, and an attention mechanism is introduced to fuse the review features obtained from the aggregated features of multiple homogeneous graphs, resulting in fused review features. This ultimately enhances the review feature representation and improves detection accuracy. Simultaneously, this invention designs a fake review detection framework based on federated learning. This framework first exchanges features of user nodes and product nodes across different dimensions between clients using differential privacy. Then, each client trains an initial detection model locally and uploads the model parameters to a central server for aggregation. The aggregation results are then returned to each client using differential privacy. This ultimately enriches the local dataset information of each client and improves detection accuracy based on federated training.
[0048] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the description, or may be learned by practice of the invention. The objects and other advantages of the invention can be realized and obtained by means of the structures specifically pointed out in the description and drawings.
[0049] Those skilled in the art will understand that the objectives and advantages achievable with the present invention are not limited to those specifically described above, and that the above and other objectives achievable with the present invention will become clearer from the following detailed description. Attached Figure Description
[0050] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings:
[0051] Figure 1 This is a schematic diagram illustrating the steps of a fake review detection model training method based on a federated graph neural network in one embodiment of the present invention.
[0052] Figure 2This is a schematic diagram of the structural flow of a fake review detection model training method based on a federated graph neural network in one embodiment of the present invention.
[0053] Figure 3 This is a schematic diagram illustrating the steps of a fake review detection method based on a federated graph neural network in one embodiment of the present invention. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.
[0055] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.
[0056] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.
[0057] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.
[0058] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.
[0059] It should be emphasized here that the step markers mentioned below are not a limitation on the order of the steps, but should be understood as meaning that the steps can be executed in the order mentioned in the embodiments, or in a different order than in the embodiments, or several steps can be executed simultaneously.
[0060] To address the limitations of existing fake review detection models in terms of limited feature representation capabilities and low detection accuracy, this invention provides a training method for a fake review detection model based on a federated graph neural network. This method is executed on each client, where each client contains aligned user entities and product entities, such as... Figure 1 As shown, the method includes the following steps S101 to S104:
[0061] Step S101: Obtain a local dataset containing reviews from multiple users for multiple products; label whether each user's review of the corresponding product in the local dataset is false.
[0062] Step S102: Obtain the initial neural network model, which is based on a graph neural network, including a GraphSage network and a graph convolutional neural network. Input the local dataset into the initial neural network model to extract features from user nodes, product nodes, and comment nodes, obtaining first user features, first product features, and first comment features. Use differential privacy to exchange the extracted first user features and first product features with other clients to enhance feature representation, obtaining second user features and second product features. Use the GraphSage algorithm to aggregate the first comment features with the second user features and second product features corresponding to its neighboring user nodes and neighboring product nodes, obtaining aggregated comment features. Construct a preset number of homogeneous graphs of comment nodes from the local dataset through a preset number of different meta-paths. In each homogeneous graph, use a graph convolutional neural network to aggregate the features of comment nodes, obtaining second comment features. Fuse the second comment features obtained from multiple homogeneous graphs based on an attention mechanism to obtain fused comment features. Concatenate the aggregated comment features and fused comment features to obtain the final feature vector. Input the final feature vector of each comment into a preset classifier to obtain the prediction result for each comment.
[0063] Step S103: In one round of training, the initial neural network model is trained using the local dataset, a loss function between the label and the prediction result is constructed, and the parameters of the initial neural network model are iterated using the loss function to obtain the initial detection model.
[0064] Step S104: Upload the parameters of the initial detection model to the central server using differential privacy to generate a shared model; wherein, the shared model is obtained by the central server aggregating the parameters of the initial detection models of each client; receive the parameters of the shared model to update the initial detection model, and perform the next round of repeated training until the initial detection model meets the preset requirements, and obtain the final fake comment detection model.
[0065] like Figure 2 The diagram shown is an overall flowchart of the training method for a fake review detection model based on federated graph neural networks.
[0066] In step S101, a dataset for training the model of this invention is first obtained. The dataset is a graph structure containing nodes of three types: users, products, and reviews. In this invention, the dataset is stored locally on each client, and is therefore referred to as the local dataset. Each client contains aligned user entities and product entities, that is, it contains the same users and products, but has different features for each dimension of the aligned user entities and product entities.
[0067] In some embodiments, the local dataset uses the Amazon2014_Electronics dataset, whose graph contains nodes of three types: users, products, and reviews.
[0068] In some embodiments, the local dataset is divided into a training set and a test set according to a preset ratio. The training set is used to train the parameters of an initial neural network model, and the test set is used to test the performance of the trained detection model. For example, the preset ratio is 8:2.
[0069] In some embodiments, a label is assigned to each user's review of a corresponding product in the local dataset to indicate whether it is false. For example, a false review is labeled as 0, and a genuine review is labeled as 1.
[0070] In step S102, an initial neural network model is obtained and designed. The initial neural network model is based on a graph neural network (GNN), including a graphSage network and a graph convolutional network (GCN).
[0071] The local dataset is input into the initial neural network to extract features from user nodes, product nodes, and comment nodes, resulting in first user features, first product features, and first comment features. For user and product feature extraction, for example, features can be constructed for each user and product node in the local dataset based on username length, the distribution of user ratings, the number of times a product is purchased, and the distribution of product ratings, assuming that each client possesses a portion of these features. For comment feature extraction, for example, features can be constructed based on comment text, the number of likes or dislikes a comment receives, and these features are shared by the clients.
[0072] Differential privacy is employed to exchange extracted first user features and first product features across different dimensions with other clients to enhance feature representation, resulting in second user features and second product features. Specifically:
[0073] First, define adjacent datasets. For any two datasets X and X', if they satisfy formula (1):
[0074]
[0075] We then consider datasets X and X' to be adjacent. For example, we denote X as the first dataset and X' as the second dataset. Here, x represents a data point in the first dataset X.
[0076] Secondly, differential privacy is defined. A random perturbation algorithm M is applied to adjacent datasets X and X', which enables the query function Pr to satisfy formula (2) within the range R:
[0077] Pr[M(X)∈O]≤e' ε Pr[M(X')∈O]+δ; (2)
[0078] It is then assumed that the random perturbation algorithm M satisfies (ε,δ) differential privacy for adjacent datasets X and X'.
[0079] Where M(·) represents the random perturbation algorithm; Pr[·] represents the query function; X represents the first dataset; X' represents the second dataset; e ’ ε represents the base of the natural logarithm; ε represents the privacy budget. δ represents the query result; δ represents the threshold.
[0080] Since the algorithm outputs of adjacent datasets are similar, a smaller privacy budget ε can achieve better privacy protection and lower model overhead. Based on the above definition, the local gradient L2 norm with a threshold δ is pruned, and a Laplacian differential privacy mechanism with average noise is applied to protect the privacy of the local dataset. For example, the average noise is 0.1, and the corresponding calculation formula is shown in formula (3):
[0081] g i =clip(g i ,δ)+Laplace(0,λ); (3)
[0082] Among them, g i This represents the first user feature and the first product feature that each client needs to exchange; clip(·) represents the clipping function; δ represents the threshold; Laplace(·) represents the Laplace function; λ represents the noise intensity.
[0083] After differential privacy feature exchange, all clients enhance the original feature representations of aligned user entities and product entities, resulting in second user features and second product features.
[0084] The GraphSage algorithm is used to aggregate the first review feature with the second user feature and the second product feature corresponding to its neighboring user node and neighboring product node, resulting in the aggregated review feature. The calculation formulas for the aggregated review feature in each layer of the GraphSage network are shown in formulas (4) and (5):
[0085]
[0086] in,
[0087]
[0088] in, Let represent the aggregated comment features obtained at layer l; W represents the matrix to be trained; e represents the comment node; AGG(·) represents the aggregation function; This represents the first comment feature of layer l-1; This represents the second user characteristic of the neighboring user nodes in layer (l-1). This represents the second product feature of the neighboring product node at level t-1; concat(·) represents the concatenation function.
[0089] The local dataset is used to construct a homogeneous graph of a predetermined number of comment nodes through a predetermined number of different meta-paths. Different meta-paths represent relationships between different comments. For example, this invention designs two meta-paths: eue and eie, where e represents a comment, u represents a user, and i represents a product. eue indicates that two comments were posted by the same user, and eie indicates that two comments belong to the same product. Therefore, a relationship is considered to exist between these two comments. An edge is established on the homogeneous graph, and two homogeneous graphs can be constructed through these two meta-paths.
[0090] Based on the above definition, in each client, given n meta-paths, n homogeneous graphs can be constructed. In each homogeneous graph, nodes represent comments, and the edges between nodes indicate whether the two nodes can be connected under the definition of meta-paths.
[0091] In each homogeneous graph, a graph convolutional neural network is used to aggregate the features of the comment nodes to obtain the second comment feature. Based on the basic idea of the graph convolutional neural network, the calculation formula for the second comment feature is shown in formula (6):
[0092]
[0093] in, Let represent the second comment feature obtained from the nth homogeneous graph at layer l+1 of the graph convolutional neural network; σ(·) represents the activation function; A represents the adjacency matrix of the comments; and Used to normalize the adjacency matrix; W represents the second comment feature obtained from the nth homogeneous image in the lth layer of the graph convolutional neural network; l This represents the weight matrix of the l-th layer of the graph convolutional neural network.
[0094] Based on formula (6), the feature representations of comments in multiple homogeneous graphs are obtained. Then, based on the attention mechanism, the second comment feature obtained by fusing multiple homogeneous graphs is a unified feature representation, that is, the fused comment feature is obtained.
[0095] First, calculate the attention weight of the comment node under each metapath, as shown in formula (7):
[0096]
[0097] Where, α e,n This represents the attention weight of comment node e on metapath n; z n This represents the attention vector along the metapath n; This represents the connection of the feature vectors of comment node e across all metapaths.
[0098] Where, α e,n The higher the value, the more information the metapath n contains for the comment node e.
[0099] After obtaining the meta-path attention weights, the fused comment features are calculated using a weighted method, as shown in formula (8):
[0100]
[0101] Where E represents the fusion comment feature; α e,n This represents the attention weight of comment node e under metapath n; This represents the feature vector of comment node e under metapath n.
[0102] The aggregated comment features and the fused comment features are concatenated to obtain the final feature vector. The final feature vector of each comment is then input into a preset classifier to obtain the prediction result for each comment.
[0103] In step S103, during one round of training, the initial neural network model is trained using a local dataset, and a loss function between the labels and the prediction results is constructed. The calculation formula of the loss function is shown in formula (9):
[0104]
[0105] Where L represents the loss function; k represents the number of comments; Indicates a label; y r,k This indicates the prediction result.
[0106] The gradients of the model and features are derived using the loss function to obtain the initial detection model for each client.
[0107] In step S104, the parameters of the initial detection model trained by each client are uploaded to the central server. However, considering that client uploads may leak data privacy because the neural model may remember the input and reconstruct the input based on the corresponding output, existing solutions use homomorphic encryption to apply to the uploaded gradient to protect data privacy. However, in the scenario of fake comment detection, due to the extremely large amount of data, this method will bring huge storage and communication costs. Therefore, this invention uses differential privacy technology to ensure data privacy and security, thus solving the above problems.
[0108] The central server aggregates the model parameters uploaded by each client and uses the FedAvg algorithm to perform a weighted average of the model parameters of each client. The calculation formula is shown in formula (10):
[0109]
[0110] Among them, R t+1 The parameters represent the client's (t+1)th iteration parameters; m represents the number of clients; R t The parameter w represents the client's parameter in the t-th iteration. i This represents the weight of client i.
[0111] Each client receives the parameters of the shared model returned by the central server to update the initial detection model and repeats the training process until the initial detection model meets the preset requirements, thus obtaining the final fake comment detection model.
[0112] Steps S103 and S104 describe the training method for federated learning. In this invention, each client installs an initial neural network model locally, meaning each client trains the same model. Each client trains its initial neural network model based on its local dataset. Due to differences in local data across clients, the trained models have different gradient parameters. Each client simultaneously uploads the parameters of its initial detection model to the central server. After the central server aggregates and updates the gradients, it returns the updated parameters to each client, which then updates its parameters and begins the next iteration. These steps are repeated until the entire training process converges, resulting in a fake review detection model for each client.
[0113] This invention also provides a method for detecting fake reviews based on federated graph neural networks, such as... Figure 3 As shown, the method includes the following steps S201 to S202:
[0114] Step S201: Obtain the data to be detected, which contains reviews from at least one user on at least one product.
[0115] Step S202: Input the data to be detected into the fake review detection model obtained by the fake review detection model training method based on federated graph neural network as described above, in order to determine whether the corresponding reviews in the data to be detected are fake reviews.
[0116] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a method for training a fake review detection model based on a federated graph neural network and a method for detecting fake reviews based on a federated graph neural network.
[0117] Corresponding to the above method, the present invention also provides an apparatus comprising a computer device, the computer device including a processor and a memory, the memory storing computer instructions, the processor executing the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the apparatus performs the steps of the method as described above.
[0118] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.
[0119] In summary, this invention provides a training method, detection method, and device for a fake review detection model based on federated graph neural networks. The fake review detection model is designed based on graph neural networks. First, a GraphSage network is used to aggregate the features of user nodes and product nodes, which are neighbors of the review node, to obtain aggregated review features. Then, multiple homogeneous graphs are constructed from heterogeneous graphs in the local dataset by designing different meta-paths. In each homogeneous graph, a graph convolutional neural network is used to aggregate the features of each review, and an attention mechanism is introduced to fuse the review features obtained from the aggregation of multiple homogeneous graphs, resulting in fused review features. This ultimately enhances the review feature representation and improves detection accuracy. Simultaneously, this invention designs a fake review detection framework based on federated learning. This framework first exchanges features of user nodes and product nodes across different dimensions between clients using differential privacy. Then, each client trains an initial detection model locally and uploads the model parameters to a central server for aggregation. The aggregation results are then returned to each client using differential privacy. This ultimately enriches the local dataset information of each client and improves detection accuracy based on federated training.
[0120] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.
[0121] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.
[0122] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.
[0123] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for training a fake review detection model based on a federated graph neural network, characterized in that, The method is performed at each client, each client containing aligned user entities and commodity entities, and includes the following steps: Obtain a local data set containing multiple user comments on multiple commodities; label a tag for whether each user's comment on a corresponding commodity in the local data set is fake or not; Obtain an initial neural network model; the initial neural network model is based on a graph neural network, including a GraphSage network and a graph convolutional neural network; input the local data set into the initial neural network model to extract features of user nodes, commodity nodes and comment nodes, obtaining first user features, first commodity features and first comment features; exchange the extracted first user features and first commodity features with other clients in a differential privacy manner to enhance feature representation, obtaining second user features and second commodity features; aggregate the first comment features with the second user features and second commodity features corresponding to neighbor user nodes and neighbor commodity nodes using a GraphSage algorithm to obtain aggregated comment features; construct a predetermined number of homogeneous graphs of comment nodes through a predetermined number of different meta-paths based on the local data set; in each homogeneous graph, aggregate the features of the comment nodes using the graph convolutional neural network to obtain second comment features; fuse the second comment features obtained from multiple homogeneous graphs based on an attention mechanism to obtain fused comment features; concatenate the aggregated comment features and the fused comment features to obtain a final feature vector; input the final feature vector of each comment into a predetermined classifier to obtain a prediction result for each comment; In one round of training, the local data set is used to train the initial neural network model, a loss function between the label and the prediction result is constructed, and the parameters of the initial neural network model are iterated using the loss function to obtain an initial detection model; Upload the parameters of the initial detection model to a central server in a differential privacy manner to generate a shared model; the shared model is aggregated by the central server according to the parameters of the initial detection models of each client; receive the parameters of the shared model to update the initial detection model and perform repeated training in the next round until the initial detection model meets the predetermined requirements to obtain a final fake comment detection model. 2.The method of claim 1, wherein, Exchanging the extracted first user features and first commodity features with other clients in a differential privacy manner also includes: Defining the first data set and the second data set as adjacent data sets, the first data set and the second data set should satisfy: Wherein, X represents the first data set; X' represents the second data set; x represents a piece of data in the first data set X; Defining a random perturbation algorithm that satisfies differential privacy for the adjacent data sets, the corresponding query function should satisfy: Pr[M(X) e O] < e' ε Pr[M(X') e O] + δ; Wherein, M(·) represents the random perturbation algorithm; Pr[·] represents the query function; X represents the first data set; X' represents the second data set; e' represents the base of the natural logarithm; ε represents the privacy budget; O represents the query result; δ represents the threshold value; Based on the above definition, the local gradient L2 norm with the threshold is clipped, and the Laplace differential privacy mechanism of the average noise is applied to protect the privacy of the local data set, and the calculation formula is: g i = clip(g i , δ) + Laplace(0, λ); where g i denotes the first user feature and the first item feature that each client needs to exchange with each other; clip(·) denotes a clipping function; δ denotes the threshold; Laplace(·) denotes Laplace; λ denotes the noise intensity. 3.The false review detection model training method based on a federated graph neural network according to claim 1, wherein, The GraphSage algorithm is used to aggregate the second user features and second commodity features corresponding to the neighbor user nodes and neighbor commodity nodes of the first comment features, to obtain aggregated comment features, and the method further includes: In the GraphSage network, the calculation formula of the aggregated comment features obtained by each layer is: wherein, represents the aggregated review features of the lth layer; W represents a matrix to be trained; e represents the review node; AGG(·) represents an aggregation function; represents the first review features of the l-1th layer; represents the second user features of the neighbor user nodes of the l-1th layer; represents the second commodity features of the neighbor commodity nodes of the l-1th layer. 4.The method of claim 1, wherein, The original heterogeneous graph of the local data set is constructed into a preset number of homogeneous graphs of comment nodes through a preset number of different meta-paths, and the meta-paths at least include two comments published by the same user and two comments belonging to the same commodity. 5.The false review detection model training method based on a federated graph neural network according to claim 1, wherein, In each homogeneous graph, the features of the comment nodes are aggregated by using the graph convolutional neural network to obtain second comment features, and the calculation formula of the second comment features is: wherein, represents the second review feature obtained by the (l+1)th layer of the graph convolutional neural network; σ(·) represents an activation function; A represents an adjacency matrix of the review; and for normalizing the adjacency matrix; represents the second review feature obtained by the lth layer of the graph convolutional neural network; W l represents a weight matrix of the lth layer of the graph convolutional neural network. 6.The false review detection model training method based on a federated graph neural network according to claim 1, wherein, Based on the attention mechanism, the second comment features of multiple homogeneous graphs are fused to obtain fused comment features, and the calculation formula of the attention weights of the comment nodes in each meta-path is: wherein, α e,n represents the attention weight of the review node e under the meta-path n; z n represents the attention vector under the meta-path n; represents the connection of the feature vector of the review node e under all meta-paths; Based on the attention weights, the fused comment features are calculated, and the calculation formula is: wherein E represents the fusion review feature; a e,n represents the attention weight of the review node e under the meta path n; represents the feature vector of the review node e under the meta path n. 7.The false review detection model training method based on a federated graph neural network according to claim 1, wherein, A loss function of the label and the prediction result is constructed, and the calculation formula of the loss function is: Wherein, L represents the loss function; k represents the number of comments; represents the label; y r,k represents the prediction result. 8.The false review detection model training method based on a federated graph neural network according to claim 1, wherein, The central server uses a federated averaging algorithm to perform weighted average processing on the parameters uploaded by each client, and the calculation formula is: wherein R t+1 represents the parameters of the client in the t+1th iteration; m represents the number of the clients; R t represents the parameters of the client in the tth iteration; w i represents the weight of the client i.
9. A fake review detection method based on a federated graph neural network, characterized in that, The method is executed on the client side, and includes the following steps: Obtaining to-be-detected data; the to-be-detected data contains comments of at least one user on at least one commodity; The to-be-detected data is input into the fake comment detection model obtained by the fake comment detection model training method based on the federated graph neural network according to any one of claims 1 to 8, to determine whether the corresponding comment in the to-be-detected data is a fake comment.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to realize the steps of the method according to any one of claims 1 to 9. The program is executed by the processor to realize the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Fraudulent user detection model construction method based on graph attention network
CN112417099A
False comment detection model training method, detection method and device
CN112463966A