A spam comment detection method based on enhanced multi-relational graph neural network
By constructing a multi-relationship graph, calculating neighborhood homogeneity and label perception scores, generating new abnormal nodes, performing undersampling and oversampling, and training a graph neural network model, the problems of class imbalance and disguise in existing spam comment detection are solved, achieving higher recognition accuracy and faster training speed.
Patent Information
- Application Number
- CN202311226113.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2043-09-22
AI Technical Summary
Existing spam comment detection methods suffer from class imbalance and relationship disguise fraud in the identification of categories. There are many virtual ones in the existing spam comment detection methods. Existing spam comment detection methods based on graph neural networks have class imbalance and disguise problems, making it difficult to effectively identify spam comments.
By constructing a multi-relationship graph, calculating neighborhood homogeneity and label perception scores, generating new abnormal nodes, performing undersampling and oversampling, and training a graph neural network model, the accuracy of spam comment identification is improved.
It improves the accuracy of spam comment identification, alleviates class imbalance and camouflage problems, and has fast model training speed, high result accuracy, and strong versatility.
Smart Images

Figure CN117312557B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a spam comment detection method, and more specifically, to a spam comment detection method based on an enhanced multi-relational graph neural network. Background Art
[0002] With the rapid development of Internet technology, e-commerce platforms have gradually replaced physical stores and become people's first choice for shopping. Among them, a large number of commodity transactions are increasingly dependent on reliable users to give reasonable and valuable reviews of items. Many people have discovered "business opportunities" here and make profits by "brushing" reviews for e-commerce. This is undoubtedly a commercial fraud that seriously misleads consumer decisions, damages the interests of e-commerce platforms and consumers, and causes significant harm to the development of e-commerce. Identifying those organized malicious attack users has profound theoretical significance and great social and economic value.
[0003] Currently, spam comment detection primarily utilizes graph neural networks (GNNs). This is because spam comments often exhibit features similar to those posted by legitimate users, in order to evade existing feature-based fraud detection methods. This makes it difficult for previous feature-based detection methods to accurately classify similar ambiguous comments. GNN-based detection methods, however, organize comments into a graph based on specific relationships, uncovering subtle information hidden within the comments to achieve accurate classification.
[0004] Even so, there are still many difficult problems to solve in GNN-based detection methods:
[0005] On the one hand, real-world data suffers from class imbalance, meaning spam reviews often outnumber legitimate ones. For example, in the public Amazon dataset used in a paper studying this issue, only 9.5% of accounts posted spam reviews, while the rest were considered legitimate. In YelpChi, a real-world review dataset from Yelp, 14.5% of reviews were spam, while the rest were considered legitimate. This class imbalance often causes fraud detection models to shift their classification boundaries toward the majority class, resulting in poor performance on the minority but more important class, namely, fraudulent entities.
[0006] On the other hand, many existing GNN-based methods ignore the "disguise" of spam comments. Disguise can be specifically divided into two categories. The first is feature-based camouflage, which manifests itself when fraudulent entities and legitimate entities are very close in feature space (at close Euclidean distances). This makes feature-based methods unable to detect this type of camouflage. Therefore, researchers have widely used GNN methods to address this problem in order to obtain more information for discrimination. The second is relational camouflage. For example, legitimate users' accounts can be used to post spam comments, thereby avoiding the situation where a single account posts only spam comments and evading detection methods based on historical user rating data. Relational camouflage often manifests itself as extremely low neighborhood homogeneity of fraudulent nodes (abnormal nodes) in the graph (i.e., most of their first-order neighbors are legitimate nodes). Simply aggregating nodes of different categories in the neighborhood using standard GNNs can weaken the discriminative information for spam comments, resulting in a closer classification boundary between the two classes and, in turn, reduced classification performance. Summary of the Invention
[0007] To solve the above problems, the technical solution adopted in this application is to provide a spam comment detection method based on an enhanced multi-relational graph neural network, comprising the following steps:
[0008] Obtain the features of user comments and convert them into feature vector form;
[0009] Using user comments as nodes, we construct a multi-relationship graph of user comments and divide it into training and test sets;
[0010] Calculate the neighborhood homogeneity and label-awareness scores of the training set to perform neighbor sampling;
[0011] Multiply the random variable with the feature vector of the abnormal node in the training set to generate a new abnormal node;
[0012] Train the graph neural network model and perform discriminative learning on the nodes in the training set;
[0013] Use the trained graph neural network model to predict the test set nodes and output the prediction results.
[0014] Preferably, the neighborhood homogeneity is calculated as follows:
[0015] Calculate the proportion coefficient of abnormal nodes in the training set ;
[0016] Calculate the mean homogeneity of the neighborhood of the abnormal node in the multi-relationship graph. The formula is as follows:
[0017]
[0018] in, represents the mean of the neighborhood homogeneity of relation r, represents the number of known abnormal nodes in the neighborhood, represents the number of known normal nodes in the neighborhood, represents the number of unknown nodes in the neighborhood, Indicates a parameter.
[0019] Preferably, before calculating the label perception score, it is necessary to train a feature-based label multilayer perceptron using the training set classification to calculate the label perception scores for all nodes of the multi-relationship graph and output the predicted probabilities of normal and abnormal categories.
[0020] Preferably, the training set of the label multilayer perceptron includes abnormal nodes in the training set and the same number of normal nodes randomly sampled from the training set.
[0021] Preferably, the neighbor sampling includes:
[0022] By utilizing neighborhood homogeneity and node label perception scores, each node in the training set is undersampled on the multi-relationship graph as a neighbor within the relationship; and the nodes with the same label perception category and the highest score are oversampled on the multi-relationship graph as neighbors in the new relationship.
[0023] Preferably, the undersampling process is as follows:
[0024] Using the mean of neighborhood homogeneity , calculate the number of neighbor samples of each node in the training set in the multi-relationship graph :
[0025]
[0026] in, Representation node The number of neighbors on relation r;
[0027] Take the batch of nodes with the highest scores in the same category as the central node in the label perception score, the number is , as neighbors within the relationship.
[0028] Preferably, the oversampling process is as follows:
[0029] All nodes in the multi-relation graph are sorted by label-aware scores, and several nodes with the highest scores in the same category are oversampled for each node as neighbors in the new relationship.
[0030] Preferably, the process of generating a new abnormal node is as follows:
[0031] For each abnormal node in the training set, k-1 new abnormal nodes are generated. The generated abnormal nodes have the same neighbors as the original abnormal nodes; where k=1 / ; The generated abnormal node formula is as follows:
[0032]
[0033] in, is the feature of the original abnormal node v, is a random variable;
[0034] About random variables The probability density function of , the formula is as follows:
[0035]
[0036] in, 、 is a hyperparameter.
[0037] Preferably, the training graph neural network model performs discriminative learning on the training set nodes, comprising the following steps:
[0038] Train the graph neural network model to learn intra-relation information aggregation and inter-relation information aggregation;
[0039] Construct the cross entropy loss function of the graph neural network and perform discriminative learning on the nodes of the training set.
[0040] Preferably, the loss function formula is as follows:
[0041]
[0042] in, Represents the feature vector of training set node v, represents the predicted label of the training set node v, It is defined as follows:
[0043] .
[0044] The present invention proposes a method for spam comment detection based on an enhanced multi-relational graph neural network. Specifically, the method mitigates the relationship camouflage of abnormal nodes by guiding neighbor sampling through neighborhood homogeneity and label-aware scores, alleviates category imbalance by generating new abnormal nodes, and improves the accuracy of spam comment recognition by utilizing a graph neural network algorithm. The method has the advantages of low computational complexity, fast model training, high result accuracy, strong versatility, and a simple and easy-to-understand method. It can be applied to e-commerce platform recommendation systems, online "water army" identification, water army detection, and other fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0046] Figure 1 A flowchart of a spam comment detection method based on an enhanced multi-relationship graph neural network provided in one embodiment of the present application;
[0047] Figure 2 A schematic diagram of a multi-relationship diagram (relationship 1) provided in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of a multi-relationship diagram (relationship 2) provided in an embodiment of the present application;
[0049] Figure 4 A schematic diagram of a sampling method provided in one embodiment of the present application;
[0050] Figure 5 A schematic diagram of an undersampling process provided in one embodiment of the present application;
[0051] Figure 6 A schematic diagram of an oversampling process provided in one embodiment of the present application;
[0052] Figure 7 A schematic diagram of the aggregation process in a graph neural network provided in one embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the technical problems, technical solutions and beneficial effects to be solved by this application more clearly understood, this application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0054] See also Figure 1 , is a flow chart of a spam comment detection method based on an enhanced multi-relationship graph neural network provided by an embodiment of the present application. For ease of explanation, only the part related to this embodiment is shown, which is detailed as follows:
[0055] In one embodiment, a spam comment detection method based on an enhanced multi-relational graph neural network includes:
[0056] Obtain the features of user comments and convert them into feature vector form;
[0057] Using user comments as nodes, we construct a multi-relationship graph of user comments and divide it into training and test sets;
[0058] Calculate the neighborhood homogeneity and label-awareness scores of the training set to perform neighbor sampling;
[0059] Multiply the random variable with the feature vector of the abnormal node in the training set to generate a new abnormal node;
[0060] Train the graph neural network model and perform discriminative learning on the nodes in the training set;
[0061] Use the trained graph neural network model to predict the test set nodes and output the prediction results.
[0062] Further, the detailed description is as follows:
[0063] S101. Under the same product category, obtain user comments on products, extract content features and behavioral features of user comments, and convert each feature into a feature vector.
[0064] Content features include the number of similar comments, the number and proportion of special symbols in comments, etc. Behavioral features include the number of comments within a certain period of time, the star rating of comments, etc. Specific content features and behavioral features can be selected by relevant professionals of each platform based on actual needs.
[0065] S102. Using user comments as nodes, generate relationship edges between nodes to obtain a multi-relationship graph of user comments; specifically, the relationship edges between nodes refer to edges connecting nodes constructed based on the relationships between user comments.
[0066] See also Figure 2 、 Figure 3 , is a schematic diagram of a multi-relationship graph provided by an embodiment of the present application. 11 user comments are represented as nodes a, b, c, d, e, f, g, h, u, v, and w in the graph. According to the relationships between the user comments selected as needed, edges connecting the nodes are constructed to form a graph structure, thereby obtaining the multi-relationship graph required by the graph neural network. The solid and dashed lines are the relationship edges between the nodes, representing two different relationships between the nodes. Figure 2 and Figure 3 Schematic diagrams of relationship 1 and relationship 2 respectively.
[0067] S103, dividing the nodes into a training set and a test set according to proportion;
[0068] In actual operation, the specific proportion is determined by relevant professionals of each platform. A certain proportion of labeled nodes is used as the training set of the model, and the unlabeled nodes are used as the test set.
[0069] S104: Use the training set to estimate the neighborhood homogeneity of the abnormal nodes in the node set; neighborhood homogeneity refers to the proportion of similar nodes in the first-order neighborhood. The specific implementation process is as follows:
[0070] S1041. Calculate the ratio coefficient of abnormal nodes in the training set ;
[0071] S1042. Calculate the mean homogeneity of the neighborhood of the abnormal node in the multi-relationship graph using the following formula:
[0072] (1)
[0073] in, represents the mean of the neighborhood homogeneity of relation r (the r-th relation in a multi-relation graph is called relation r), represents the number of known abnormal nodes in the neighborhood, represents the number of known normal nodes in the neighborhood, represents the number of unknown nodes in the neighborhood, Indicates a parameter.
[0074] In one embodiment, 10 nodes are marked as a training set. If there are 2 abnormal nodes, the proportional coefficient If there are two abnormal nodes in the training set in the relationship r, the abnormal nodes are known in the first-order neighborhood There are 3 known normal nodes There are 7 unknown nodes There are 40. =0.05, the mean of its neighborhood homogeneity =(3+0.2*40) / 50-0.05=0.17.
[0075] S105: Use the training set to train a feature-based label multilayer perceptron (MLP) to calculate the label perception score of each node. The specific implementation process is as follows:
[0076] S1051. Using the undersampling method, randomly sample normal nodes with the same number as abnormal nodes from the training set for training the label perception machine MLP.
[0077] S1052, perform classification training on the label perception machine MLP based on node features, and express the classification results in the form of label perception scores. Calculate label perception scores for all nodes in the multi-relationship graph. The prediction results are as follows:
[0078] (2)
[0079] in, represents the node feature vector, The activation function is defined as follows:
[0080] (3)
[0081] Where z= , for Output the results.
[0082] go through function, The predicted category will be , that is, two decimals that add up to 1, and the two decimals are the predicted probabilities of normal and abnormal categories respectively.
[0083] S106. Using neighborhood homogeneity and node label perception scores, each node in the training set is undersampled on the multi-relationship graph as a neighbor within the relationship. In order to make up for the connections between abnormal nodes that are deliberately avoided and may be crucial for the discrimination of the model, the present invention also oversamples the multi-relationship graph. Specifically, the nodes with the same label perception category and the highest score are oversampled on the multi-relationship graph as neighbors in the new relationship, thereby alleviating the relationship disguise problem of abnormal nodes, and using the feature-based label multi-layer perceptron as a sampling guide to avoid the discriminant features of abnormal nodes being blurred by too many normal nodes in the neighborhood. The specific implementation process is as follows:
[0084] S1061, using the mean of neighborhood homogeneity , calculate the number of neighbor samples of each node in the training set in the multi-relationship graph :
[0085] (4)
[0086] in, Representation node The number of neighbors on relation r.
[0087] S1062. Using the label perception score, undersample the first-order neighbors of each node in the training set in the multi-relation graph according to the following rules:
[0088] Sort neighbor nodes according to label perception scores;
[0089] Take the batch of nodes with the highest scores in the same category as the central node in the label perception score, the number is , as neighbors within the relationship.
[0090] Specifically, in one embodiment, the number of neighbor samples in the training set is calculated: There are 10 neighbor nodes in the first-order neighborhood of relation r. =0.17*10=1.7, here all decimals are rounded up, then = 2. Then, nodes are sorted according to the label-aware scores (see Figure 4 Nodes close to the label-aware classification boundary have similar normal and abnormal class probability scores. Nodes further from the label-aware classification boundary have a larger difference between normal and abnormal class probability scores. Furthermore, nodes that are closer to normal have higher normal class probability scores, while nodes that are closer to abnormal have higher abnormal class probability scores. The central node is the abnormal class, so the two nodes with the highest scores in both abnormal classes are selected as neighbors within the relationship.
[0091] See also Figure 4 The figure also intuitively illustrates the difference between this application's method and previous approaches. This application argues that nodes with high label perception scores, regardless of category, possess more prominent discriminative information and are more effective in the aggregation process of graph neural networks. Previous approaches, on the other hand, sample nodes with similar characteristics to the central node, making them more likely to sample heterogeneous nodes (of a different category than the central node). This can obscure abnormal discriminative information during the aggregation process, resulting in a decrease in the model's discriminative performance.
[0092] See also Figure 5 , is an embodiment of the present application, and follows Figure 2 The two relationship diagrams show the undersampling results of the neighbors with node v as the center node, in which the points and edges outside the neighborhood and discarded during the sampling process are represented as virtual.
[0093] S1063. Also using the label-aware score, all nodes in the multi-relationship graph are sorted by score, and each node is oversampled to several nodes with the highest scores in the same category. The connections between the new nodes obtained by oversampling are represented as new relationships in the multi-relationship graph, and the oversampled nodes are neighbors in the new relationships.
[0094] See also Figure 6 , is an embodiment of the present application, and follows Figure 2 The two relationship diagrams show the oversampling results of the neighbors with node v as the center node. The oversampled number of nodes is 2 as the neighbors of the new relationship. This process only considers the characteristics of the nodes without considering the connections between the nodes.
[0095] S107: Multiply the feature vector of the abnormal node by the random variable to generate a new abnormal node that is close to the original abnormal node in the feature space and add it to the training set to alleviate the class imbalance problem in the data. The specific implementation process is as follows:
[0096] For each abnormal node in the training set, k-1 new abnormal nodes are generated. The generated abnormal nodes have the same neighbors as the original abnormal nodes; where k=1 / , the purpose is to balance the category ratio of the training set nodes. The generated abnormal node formula is as follows:
[0097] (5)
[0098] in, is the feature of the original abnormal node v, is a random variable;
[0099] About random variables The probability density function of , the formula is as follows:
[0100] (6)
[0101] in, 、 is a hyperparameter.
[0102] S108: Train the graph neural network model, construct the cross entropy loss function of the graph neural network, and perform discriminative learning on the nodes in the training set. The specific implementation process is as follows:
[0103] S1081. Train the graph neural network model to perform intra-relation information aggregation and inter-relation information aggregation learning. The specific implementation process is as follows:
[0104] S10811. For the first-layer graph neural network, perform intra-relationship information aggregation and inter-relationship information aggregation. The intra-relationship information aggregation formula is as follows:
[0105] (7)
[0106] in, Representation node Aggregate features at level 1 on relation r, Represents the learnable weight coefficient of the first layer GNN (graph neural network) on the relationship r, r=1,2...R, Representation node Features at layer 0, i.e. original features; represents the concatenation operation of feature vectors, represents the mean aggregation function, Representation node In the features at layer 0, For nodes Neighbor nodes of Representation node Neighbors on relation r. The activation function is defined as follows:
[0107] (8)
[0108] The formula for information aggregation between relationships is as follows:
[0109] (9)
[0110] in, Representation node The output features of the first layer of GNN (graph neural network), Representation node Aggregate features of oversampled relations, Represents the learnable weight coefficients on the first layer of GNN (graph neural network), Representation node Aggregate features of neighbor nodes at level 1 of relation 1, Represents the aggregated features of the first layer of neighbor nodes of the last relationship of node v on a multi-relationship graph.
[0111] S10812. For the second and subsequent graph neural networks, let the current layer be L, and use the output features of the L-1 layer Perform intra-relationship information aggregation and inter-relationship information aggregation; the intra-relationship information aggregation formula is as follows:
[0112] (10)
[0113] in, Representation node The aggregated features at level L on relation r, represents the learnable weight coefficient of the L-th layer GNN (graph neural network) on the relation r, Representation node Features at layer 0, i.e. original features; represents the concatenation operation of feature vectors, represents the mean aggregation function, Representation node In the features at layer 0, For nodes Neighbor nodes of Representation node Neighbors on relation r.
[0114] The formula for information aggregation between relationships is as follows:
[0115] (11)
[0116] in, Representation node The output features of the L-th layer GNN (graph neural network), represents the learnable weight coefficient on the L-th layer GNN (graph neural network), Representation node The output features of the L-1 layer GNN (graph neural network), Represents the aggregated features of node v’s neighbor nodes at level L in relation 1, Represents the aggregated features of the first layer of neighbor nodes of node v in the last relationship.
[0117] S1082. Construct a cross entropy loss function for the graph neural network and perform discriminative learning on the nodes in the training set. The loss function is as follows:
[0118] (12)
[0119] in, Represents the feature vector of training set node v, represents the predicted label of the training set node v, It is defined as follows:
[0120] (13)
[0121] S109. Use the trained graph neural network model to predict the test set nodes and output the test set prediction results.
[0122] See also Figure 7 , is a schematic diagram of the polymerization process provided in one embodiment of the present application. represents the center node / target node of relationship 1, represents the center node / target node of relationship 2, Representation node final( ) generated discriminant features, represents the neighbors of relation 1, represents the neighbors of relation 2, represents oversampling new neighbors.
[0123] The following experiments verify the effectiveness of the proposed method based on real data published in the art. The datasets used in the experiments are the preprocessed Yelp dataset and the Amazon dataset from Jhy1993 / HAN.
[0124] The YelpChi dataset collects hotel and restaurant reviews from Yelp. The nodes in the YelpChi dataset graph are reviews with 32-dimensional features, and there are three relationships between them:
[0125] 1) RUR represents comments posted by the same user;
[0126] 2) RSR is the rating of the same star for the same product;
[0127] 3) RTR refers to the reviews of the same product in the same month.
[0128] The Amazon dataset contains product reviews under the category of musical instruments. The nodes in the Amazon dataset graph are users with 25-dimensional features and contain three relationships:
[0129] 1) UPU connects users who have reviewed at least one of the same products;
[0130] 2) USU has at least one user with the same star rating within a week;
[0131] 3) UVU connects the top 5% users in terms of TF-IDF similarity in their mutual reviews.
[0132] The statistical results of these two datasets are shown in Table 1.
[0133] Table 1 Dataset data
[0134]
[0135] The relationship homogeneity refers to the average homogeneity of the abnormal node neighborhood of all nodes in the relationship calculated according to step S104 of the present application.
[0136] The evaluation indicators and their introduction are as follows:
[0137] (1) AUC: The area under the ROC curve, a ranking-related metric, is unbiased for class imbalance in fraud detection. Since AUC is unbiased for label distribution, training for AUC tends to yield a model that is competitive in classifying both majority (benign users) and minority (fraudulent users) samples.
[0138] (2) AP: The Area Under The Precision Recall Curve, which focuses more on the ranking of fraudulent entities rather than the ranking of benign entities.
[0139] (3) F1-score: The abnormal category is f1-Fraud, the normal category is f1-benign, and the mean of the two is f1-macro.
[0140] The values of the above indicators are in the range of [0,1], and the larger the value, the better the performance.
[0141] The proposed method was verified on two public datasets, and the experimental results are shown in Table 2 below.
[0142] Table 2 Experimental results on public datasets
[0143]
[0144] Our proposed method achieves optimal results in almost all evaluation and annotation aspects of both datasets, significantly improving upon existing methods and generally outperforming all compared methods.
[0145] On the other hand, we also conducted corresponding experimental research on the impact of the proportion of labeled nodes on the proposed method. The experimental results on the Yelp dataset are shown in Table 3 below.
[0146] Table 3 Homogeneity calculation experiment of Yelp dataset
[0147]
[0148] The data in the analysis table can reduce the number of marked nodes, and the estimation of the homogeneity of the neighborhood of abnormal nodes is basically not affected.
[0149] Through the above analysis, it can be found that the present invention has the following advantages:
[0150] First, compared with other methods, the present invention retains the advantages of the multi-relationship graph neural network algorithm while having significant advantages in solving the problem of class imbalance in identifying highly disguised fraudsters.
[0151] Secondly, in terms of interpretability, the neighborhood homogeneity calculation and label-aware sampling in the sampling stage are simple and easy to understand. Experimental results also show that the performance is basically unaffected when there are relatively few labeled nodes.
[0152] Finally, the method used in the present invention achieved the best results in various accuracy evaluation indicators of two public datasets in this problem field.
[0153] In summary, the recognition method provided by the present invention has a better ability to identify disguised fraudsters and can detect highly disguised fraudsters. It also proves that new sampling methods and data augmentation methods can be used to alleviate the class imbalance problem in the data and improve the recognition accuracy of fraudsters.
[0154] The proposed method effectively improves the accuracy of identifying fraudsters in disguise, outperforming existing methods across all accuracy metrics on two publicly available datasets in this area. Furthermore, by decoupling the neighbor sampling module from graph neural network training, the proposed method significantly reduces the time required for repeated neighbor sampling during graph neural network training, resulting in a faster training process compared to existing methods.
[0155] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel 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 application.
[0156] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A spam comment detection method based on an enhanced multi-relational graph neural network, characterized by: The following steps are involved: Obtain the features of user comments and convert them into feature vector form; Using user comments as nodes, we construct a multi-relationship graph of user comments and divide it into training and test sets; Calculate the neighborhood homogeneity and label-awareness scores of the training set to perform neighbor sampling; Multiply the random variable with the feature vector of the abnormal node in the training set to generate a new abnormal node; Train the graph neural network model and perform discriminative learning on the nodes in the training set; Use the trained graph neural network model to predict the test set nodes and output the prediction results; The neighbor sampling includes: By using neighborhood homogeneity and node label perception scores, each node in the training set is undersampled on the multi-relation graph as a neighbor within the relationship; the nodes with the same label perception category and the highest score are oversampled on the multi-relation graph as neighbors in the new relationship; The process of generating a new abnormal node is as follows: For each abnormal node in the training set, k-1 new abnormal nodes are generated. The generated abnormal nodes have the same neighbors as the original abnormal nodes; where k=1 / , is the proportional coefficient of abnormal nodes; the generated abnormal node formula is as follows: , in, is the feature of the original abnormal node v, is a random variable; About random variables The probability density function of , the formula is as follows: , in, 、 is a hyperparameter; The training graph neural network model performs discriminative learning on the training set nodes, including the following steps: Train the graph neural network model to learn intra-relation information aggregation and inter-relation information aggregation; Construct the cross entropy loss function of the graph neural network and perform discriminative learning on the nodes of the training set.
2. The method for detecting spam comments based on an enhanced multi-relational graph neural network according to claim 1, wherein: The calculation process of the neighborhood homogeneity is as follows: Calculate the proportion coefficient of abnormal nodes in the training set ; Calculate the mean homogeneity of the neighborhood of the abnormal node in the multi-relationship graph. The formula is as follows: , in, represents the mean of the neighborhood homogeneity of relation r, represents the number of known abnormal nodes in the neighborhood, represents the number of known normal nodes in the neighborhood, represents the number of unknown nodes in the neighborhood, Indicates a parameter.
3. The method for detecting spam comments based on an enhanced multi-relational graph neural network according to claim 1, wherein: Before calculating the label perception score, it is necessary to use the training set classification to train a feature-based label multi-layer perceptron to calculate the label perception score for all nodes of the multi-relationship graph and output the predicted probability of normal and abnormal categories.
4. The method for detecting spam comments based on an enhanced multi-relational graph neural network according to claim 3, wherein: The training set of the label multilayer perceptron includes abnormal nodes in the training set and the same number of normal nodes randomly sampled from the training set.
5. The method for detecting spam comments based on an enhanced multi-relational graph neural network according to claim 3, wherein: The undersampling process is as follows: Using the mean of neighborhood homogeneity , calculate the number of neighbor samples of each node in the training set in the multi-relationship graph : , in, Representation node The number of neighbors on relation r; Take the batch of nodes with the highest scores in the same category as the central node in the label perception score, the number is , as neighbors within the relationship.
6. The method for detecting spam comments based on an enhanced multi-relational graph neural network according to claim 3, wherein: The oversampling process is as follows: All nodes in the multi-relation graph are sorted by label-aware scores, and several nodes with the highest scores in the same category are oversampled for each node as neighbors in the new relationship.
7. The method for spam comment detection based on an enhanced multi-relational graph neural network according to claim 1, wherein the loss function formula is as follows: , in, Represents the feature vector of training set node v, represents the predicted label of the training set node v, It is defined as follows: , in, Representation node Output features of the L-th layer graph neural network.
Citation Information
Patent Citations
E-commerce anti-fraud method of multi-relational graph neural network based on precise sampling adaptive neighborhood
CN116579787A