A water army identification method based on graph contrastive learning

CN118467803BActive Publication Date: 2026-09-18UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410532825.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-30
Publication Date
2026-09-18
Estimated Expiration
2044-04-30

AI Technical Summary

Technical Problem

然而,现有的水军识别方法尚未尝试将图对比学习技术纳入考虑,这可能是一个潜在的改进方向

Benefits of technology

[0032] 1. This method uses user post text information as user features, extracts words from user posts, and combines them with user social networks to construct a user-word heterogeneous graph, thus achieving deep integration of user feature information and social network structure information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118467803B_ABST
    Figure CN118467803B_ABST
Patent Text Reader

Abstract

The application discloses a water army identification method based on graph contrast learning, and belongs to the field of fraud detection or network security in machine learning. The method takes the user post text information as the user feature information, and takes the words in the user post text as the network nodes and the user social network to form a user-word heterogeneous graph, so that the deep fusion of the user feature information and the social network structure information is realized. In addition, the method applies the contrast learning technology to the water army identification field, and on the basis of the existing graph contrast learning technology, different types of edges are calculated by different methods according to the characteristics of the heterogeneous graph to generate an enhanced graph by calculating the edge discard probability, so that the water army identification effect is improved. The application has good identification effect, and the accuracy and F1 value are better than those of the existing method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of fraud detection or cybersecurity within the field of machine learning. Background Technology

[0002] As a crucial element of social networks, online trolls can disrupt the normal order of these networks, negatively impact user experience, and even spread misinformation and rumors, causing adverse social effects. Therefore, researching methods for identifying online trolls is essential for maintaining the fair, impartial, and secure operation of social networks. Furthermore, identifying and combating online troll activities can help improve the credibility of social network platforms and user satisfaction, thus promoting the sustainable development of social networks.

[0003] Existing methods for identifying online trolls can be mainly divided into two types: feature-based and network structure-based. Feature-based methods typically utilize users' textual or behavioral features to identify troll users, including SMFSR, MVSD, and DatingSec. However, these methods only consider user feature information and ignore the information propagation process within the social network structure. How to effectively integrate network structure information for troll detection has become a focus of academic attention. With the development of graph convolutional neural networks, some network structure-based methods have been proposed, such as MDM, DeG-Spam, and MDGCN (Markov-Driven Graph Convolutional Networks).

[0004] However, existing technologies have some shortcomings. Feature-based methods ignore social network structure information, while network structure-based methods, although incorporating social network structure information into graph convolutional neural networks, simply use user features as input. For example, MDGCN only uses the bag-of-words model as user feature input, failing to achieve a deep fusion of user feature information and social network structure information.

[0005] Furthermore, graph contrastive learning, as a significant achievement in the field of graph learning in recent years, has made remarkable progress in areas such as node classification, graph classification, and graph generation. However, existing methods for identifying online trolls have not yet incorporated graph contrastive learning techniques, which could be a potential direction for improvement.

[0006] In conclusion, combining graph contrastive learning techniques with existing methods for identifying online trolls is expected to improve the accuracy and efficiency of troll detection, further promoting the healthy development of social networks and enhancing user experience. Summary of the Invention

[0007] This invention addresses the shortcomings of existing technologies by providing a method for detecting and identifying online trolls based on graph contrastive learning. This method uses user-posted text information as user feature information and integrates words from the user's post text as network nodes with the user's social network to form a user-word heterogeneous graph, achieving deep fusion of user feature information and social network structure information. Furthermore, this method applies contrastive learning technology to the field of online troll identification. Building upon existing graph contrastive learning techniques, it calculates edge discard probabilities using different methods for different types of edges to generate an enhanced graph, improving the effectiveness of online troll identification. This invention demonstrates superior identification performance, with accuracy and F1 score compared to existing methods.

[0008] This invention discloses a method for identifying online trolls based on graph contrast learning, the method comprising:

[0009] Step 1: Data preprocessing. Clean the acquired user post text information data and delete useless and redundant data.

[0010] Remove stop words and words that appear less than a set threshold from user post text data, and filter out user nodes whose post text information is less than a set threshold;

[0011] Step 2: Construct connections between users;

[0012] Construct connections between users based on the follow and follow relationships among the filtered posting users;

[0013] Step 3: Construct edges between words;

[0014] Based on the GloVe word vector model, the filtered words are converted into word vectors, and the cosine similarity between word vectors is calculated. The edges between words are constructed based on the cosine similarity between word vectors.

[0015] Step 4: Construct the edges between users and words;

[0016] Analyze the frequency of the filtered words among the users who posted them, and construct the connection between users and words based on this frequency.

[0017] Step 5: Construct a user-word heterogeneity graph;

[0018] Based on the filtered posting users and the words in the filtered post text, and combining the edges between users, the edges between words, and the edges between users and words, a heterogeneous graph containing both user and word nodes is constructed.

[0019] Step 6: Construct a graph convolutional neural network model;

[0020] Based on graph convolutional neural networks, a graph convolutional neural network model with two graph convolutional layers and one fully connected layer is constructed, denoted as f(·). Inputting the constructed user-word heterogeneous graph into this graph convolutional neural network model yields the representation vector for each user, denoted as: in This represents the user-word heterogeneous graph, where X is the obtained user representation vector.

[0021] Step 7: Augment the user-word heterogeneity graph;

[0022] Different adaptive edge discarding strategies are applied to different types of edges to obtain two augmented graphs of the user-word heterogeneous graph, denoted as: For user-user edges, the edge discard probability is set based on the degree of the tail node; for word-word edges, the edge discard probability is set based on the inverse document frequency of the word; for user-word edges, the edge discard probability is set by combining the degree of the user and the inverse document comment of the word.

[0023] Step 8: Pre-train the model based on contrastive learning;

[0024] By inputting the two augmented graphs into the graph convolutional neural network model, the corresponding user representation vector is obtained, denoted as: The improved contrastive learning loss function, based on the noise contrastive estimation loss function, is as follows:

[0025]

[0026] Where N represents the number of user nodes, U i represent The representation vector of the i-th user node, V i express The representation vector of the i-th user node, τ is the temperature coefficient, which is a hyperparameter in the noise contrast estimation loss function that controls the model's ability to distinguish negative samples; the pre-trained model can be obtained by training the model parameters based on the gradient descent method.

[0027] Step 9: Fine-tune the model by adding labeled training set data;

[0028] Original user-word heterogeneity graph By feeding the data into a pre-trained graph convolutional neural network model, the user representation vector X can be obtained. Where P is the probability that a user is a paid troll, and F(·) is a fully connected layer; the loss function is:

[0029] L fine =mean(L),L={l1,l2,...,l n , ..., l N′} T , ln =-w n [y n ·logp n +(1-y n )·log(1-p n )]

[0030] Where mean(L) represents the average value of L, N′ is the number of nodes in the training set, and w n p represents the weight of the nth user. n y represents the probability that the nth user is a paid troll. n It is the actual label of the nth user, and y n ={0, 1}, y n =1 indicates that the nth user is a paid troll; the final paid troll prediction model can be obtained by fine-tuning the model parameters based on the gradient descent method.

[0031] Compared with existing technologies, the advantages of this invention are as follows:

[0032] 1. This method uses user post text information as user features, extracts words from user posts, and combines them with user social networks to construct a user-word heterogeneous graph, thus achieving deep integration of user feature information and social network structure information.

[0033] 2. This method applies graph contrast learning technology to the field of online troll identification and improves the graph enhancement method according to the characteristics of heterogeneous graphs. It uses different methods to calculate the edge drop probability of different types of edges to generate enhanced graphs, which helps to improve the effect of online troll identification.

[0034] 3. The method of identifying online trolls is superior to existing methods. Under the same dataset and the same proportion of training set, the method achieves better performance in terms of accuracy and F1 score. Attached Figure Description

[0035] Figure 1 This is a flowchart of the method of the present invention.

[0036] Figure 2 This is a schematic diagram of the user-word heterogeneity graph constructed in this invention.

[0037] Figure 3 This is a diagram of the overall model architecture of the present invention.

[0038] Figure 4 This is a comparison chart of the accuracy and F1 score between our method and the MDGCN method.

[0039] Figure 5 This is a comparison of the accuracy and F1 score of our method and the method after the ablation pre-training step. Detailed Implementation Plan

[0040] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings.

[0041] The detailed workflow of this invention is as follows:

[0042] 1. Remove stop words from user-posted text and remove words that appear less than 10 times, resulting in a word list Word = {w1, w2, ..., w...} m}. Then remove users whose posts contain 3 or fewer words in the Word list, resulting in a user list User = {u1, u2, ..., u...}. n}

[0043] 2. Construct edges between users based on their follow relationships, using the formula: a ij =1, if node i ∈User, node j ∈User, node i follow node j , where a ij =1 represents a node i There is a connection to node j And a one-way edge with a weight of 1.

[0044] 3. Based on the GloVe word vector model, the filtered words are converted into word vectors, denoted as Wemb, and the cosine similarity between word vectors is calculated. Edges between words are then constructed based on the cosine similarity, using the formula: a ij =sim(i,j), if node i ∈Word, node j ∈Word, sim(i,j)>0.5, Where sim(i,j) represents node i With node j The cosine similarity of the corresponding word vectors, Wemb i It is a node i The corresponding word vectors, Wemb j It is a node j The corresponding word vectors.

[0045] 4. Construct edges between users and words and users based on the frequency of word occurrences in user posts, using the formula: a ij =freq ij if node i ∈User, node j ∈Word, where freq ijThe word "node" represents j In user node i Number of times it appears in the posts.

[0046] 5. Based on the word list `Word` and the user list `User`, and combining the edges between users, between words, and between users and words, construct a heterogeneous graph containing both user and word nodes, denoted as [Graph showing connections between users and words]. set up For the image Given the adjacency matrix, the formula is:

[0047]

[0048] Among them, a ij This represents the value in the i-th row and j-th column of A.

[0049] 6. Construct a graph convolutional neural network model with two graph convolutional layers and one fully connected layer. The formula for the graph convolutional layer is: The formula for a fully connected layer is:

[0050] in, The overall network model can be represented by f(·), which is the user-word heterogeneous graph constructed from the input of the graph convolutional neural network model. Then the representation vector of each user is obtained, denoted as:

[0051] 7. Calculate the importance value for different types of edges, and then calculate the edge discard probability based on the importance value. For user-user edges, calculate the importance value based on the degree of the tail node, using the following formula: Where degree(j) represents the number of edges connected to node j. For word-word edges, importance is calculated based on the word's inverse document frequency, using the following formula: Where IDF(i) and IDF(j) represent the inverse document frequencies of word i and word j, respectively, and are calculated using the following formula: Where n represents the total number of users, and x(i) represents the number of users whose posts contain the word i. For user-word edges, the importance value is calculated based on the degree of user i and the inverse document frequency of word j, using the following formula:

[0052] Then, calculate the edge discard probability based on the importance value, using the following formula:

[0053]

[0054]

[0055]

[0056] in These represent the maximum importance values ​​among user-user edges, word-word edges, and user-word edges, respectively. These represent the average importance values ​​of all edges in user-user edges, word-word edges, and user-word edges, respectively. p represents the importance value of the edge connecting user i to user j in user-user edges, word-word edges, and user-word edges, respectively. e and p τ There are two hyperparameters. Let {p e p τ The values ​​are set to {0.2, 0.7} for the graph. Obtain an enhanced graph by discarding edges. {p e p τ The values ​​are set to {0.3, 0.7} for the graph. Obtain an enhanced graph by discarding edges.

[0057] 8. By inputting the two augmented graphs into a graph convolutional neural network model, the corresponding user representation vector is obtained, denoted as: The improved contrastive learning loss function, based on the noise contrastive estimation loss function, is as follows: Where N represents the number of user nodes, U i represent The representation vector of the i-th user node, V i express The representation vector of the i-th user node is given, and τ is the temperature coefficient, which serves as a hyperparameter in the noise contrast estimation loss function and controls the model's ability to distinguish negative samples. The optimizer is set to Adam, with τ = 0.4, a learning rate of 0.1, a batch size of 512, and an epoch of 300 to train the model and obtain a pre-trained model.

[0058] 9. Transform the original user-word heterogeneity graph By feeding the data into a pre-trained graph convolutional neural network model, the user representation vector X can be obtained. Where P is the probability that a user is a paid troll, F(·) is a fully connected layer; the loss function is BCELoss (binary cross-entropy loss), and the specific formula is: L fine =mean(L),L={l1,l2,...,l n , ..., l N′} T , l n =-w n [y n ·logp n +(1-y n )·log(1-pn ]], where mean(L) represents the average value of L, N′ is the number of nodes in the training set, and w n p represents the weight of the nth user. n y represents the probability that the nth user is a paid troll. n It is the actual label of the nth user, and y n ={0, 1}, y n =1 indicates that the nth user is a paid troll. The optimizer is set to Adam with a learning rate of 0.01, and an early stopping strategy is adopted. The early stopping parameters are set to patience (10), min_delta (0.0002), and monitor (val_loss). The pre-trained model is then fine-tuned to obtain the final paid troll prediction model.

[0059] 10. Add experimental examples

[0060] We use the Twitter Social Honeypot dataset (TwitterSH) to evaluate our method. This dataset contains labeled spammers and legitimate users, along with their corresponding tweets. Due to the lack of social network information, we use an external Twitter social graph dataset to extract the social relationships of users in the TwitterSH dataset. After data preprocessing, we divide the dataset into training, validation, and test sets in a 4:1:5 ratio, meaning the maximum proportion of the training set is 40%. We choose MDGCN() as a comparison method. For MDGCN, we fine-tune the hyperparameters from the original paper to obtain the best validation set results. We compare the accuracy and F1 score of MDGCN and our method at training set proportions of [8%, 16%, 24%, 32%, 40%], and the experimental results are as follows: Figure 4 As shown, the results demonstrate that our method outperforms MDGCN under different proportions of training sets.

[0061] Furthermore, to verify the effectiveness of the graph contrast learning pre-training step in our proposed method, while keeping the hyperparameters constant, we compared the accuracy and F1 score of the method that ablated the pre-training step with our proposed method at training set proportions of [8%, 16%, 24%, 32%, 40%]. The experimental results are as follows: Figure 5 As shown, the results demonstrate that the pre-training step can effectively improve the accuracy and F1 score of identifying online trolls.

Claims

1. A method for identifying online trolls based on graph contrastive learning, the method comprising: Step 1: Data preprocessing, cleaning the acquired user post text information data and deleting useless and redundant data; Remove stop words and words that appear less than a set threshold from user post text data, and filter out user nodes whose post text information is less than a set threshold; Step 2: Construct connections between users; Construct connections between users based on the follow and follow relationships among the filtered posting users; Step 3: Construct edges between words; Based on the GloVe word vector model, the filtered words are converted into word vectors, and the cosine similarity between word vectors is calculated. The edges between words are constructed based on the cosine similarity between word vectors. Step 4: Construct the edges between users and words; Statistically analyze the frequency of the filtered words among the users who posted them, and construct the connection between users and words based on this frequency. Step 5: Construct a user-word heterogeneity graph; Based on the filtered posting users and the words in the filtered post text, and combining the edges between users, the edges between words, and the edges between users and words, a heterogeneous graph containing both user and word nodes is constructed. Step 6: Construct a graph convolutional neural network model; Based on graph convolutional neural networks, a graph convolutional neural network model with two graph convolutional layers and one fully connected layer is constructed, denoted as f(·). Inputting the constructed user-word heterogeneous graph into this graph convolutional neural network model yields the representation vector for each user, denoted as: in This represents the user-word heterogeneous graph, where X is the obtained user representation vector. Step 7: Augment the user-word heterogeneity graph; Different adaptive edge discarding strategies are applied to different types of edges to obtain two augmented graphs of the user-word heterogeneous graph, denoted as: For user-user edges, the edge discard probability is set based on the degree of the tail node; for word-word edges, the edge discard probability is set based on the inverse document frequency of the word; for user-word edges, the edge discard probability is set by combining the degree of the user and the inverse document comment of the word. Step 8: Pre-train the model based on contrastive learning; By taking the two augmented graphs as inputs to construct a graph convolutional neural network model, the corresponding user representation vector is obtained, denoted as: The improved contrastive learning loss function, based on the noise contrastive estimation loss function, is as follows: Where N represents the number of user nodes, U i represent The representation vector of the i-th user node, V i express The representation vector of the i-th user node, τ is the temperature coefficient, which is a hyperparameter in the noise contrast estimation loss function that controls the model's ability to distinguish negative samples; the pre-trained model can be obtained by training the model parameters based on the gradient descent method. Step 9: Fine-tune the model by adding labeled training set data; Original user-word heterogeneity graph By feeding the data into a pre-trained graph convolutional neural network model, the user representation vector X can be obtained. Where P is the probability that a user is a paid troll, and F(·) is a fully connected layer; the loss function is: L fine =mean(L),L={l1,l2,...l n ,...,l N′ } T ,l n =−ω n [y n ·logp n +(1-y n )·log(1-p n )] Where mean(L) represents the average value of L, N′ is the number of nodes in the training set, and ω n p represents the weight of the nth user. n y represents the probability that the nth user is a paid troll. n It is the actual label of the nth user, and y n ={0, 1}, y n =1 represents the nth; The users are online trolls; the final online troll prediction model can be obtained by fine-tuning the model parameters based on the gradient descent method.