A social robot detection method based on multi-relational graph convolutional network
Through the multi-relational graph convolution network method, social robots are detected using distributed crawlers and R-GCN models, and the problems of artificial feature extraction bias and insufficient detection of the new generation of robots are solved, achieving accurate detection in a real social network environment.
Patent Information
- Application Number
- CN202211622290.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-12-16
AI Technical Summary
The prior art has problems of artificial feature extraction bias and high cost when detecting social robots, and cannot effectively identify the real malicious behavior of the new generation of social robots, and ignores the differences in the impact of different relationship types on neighbors.
The multi-relational graph convolution network method is adopted to collect user data through distributed crawlers, extract user profiles, abstracts and relationship characteristics, build multi-relational social network diagrams, and use R-GCN network model for training and detection. Combining user profiles and abstract features, considering the influence intensity of different relationship types.
Accurate detection of social robots in real social network environments is achieved, bias and cost of artificial feature extraction is reduced, and more edge types are supported, and it is suitable for real social network environments with unbalanced samples.
Smart Images

Figure CN115952343B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a social robot detection method based on a multi-relational graph convolutional network. Background Art
[0002] With the rapid development of internet technology, online social networks (OSNs) have revolutionized the scope and experience of human communication through real-time information dissemination, providing users with convenience in information sharing, knowledge acquisition, and entertainment. However, the real-time messaging, large user base, and open and anonymous nature of OSN platforms have led to the emergence of a large number of social bots. Social bots are automated programs with specific purposes that automatically generate content and interact with users. The presence of malicious social bot accounts has seriously disrupted the daily operations of social networking platforms, exerting unprecedented illicit influence on the structure and discourse of OSN platforms. Therefore, accurately detecting social bots on OSN platforms has become crucial.
[0003] Early social bot detection methods were typically feature-based. Researchers extracted numerical features from user metadata, user tweets, and user relationships, combining them with traditional machine learning classifiers for bot detection. However, this approach is not only labor-intensive and time-consuming, but attackers can also improve their strategies to circumvent the proposed features, making it unsuitable for real social network environments. With the development of deep learning, researchers have also proposed text-based methods that use text analysis techniques such as word embeddings, recurrent neural networks, and pre-trained language models to analyze tweet content for bot detection. However, the new generation of social bots often intersperse malicious content with legitimate tweets from real users, rendering these methods ineffective. Recent research has focused on developing graph-based social bot detection models. These methods use users as nodes and relationships between users as edges, leveraging graph mining techniques for graph-based social bot detection.
[0004] Existing social bot detection methods have the following main problems: 1. Feature-based methods require manual feature extraction, which carries certain human biases and consumes a lot of manpower costs; 2. Text-based methods treat all tweets of a user equally, failing to detect the real malicious behavior of the new generation of bot users and unable to effectively identify them; 3. Graph-based methods currently focus mainly on isomorphic graphs, ignoring the fact that neighbors of different relationship types will have different influence strengths. In real social network environments, there are multiple relationship types between users, so it is impossible to obtain true and effective user representation.
[0005] Therefore, how to propose a solution to the above problems is a problem that those skilled in the art need to solve at present. Summary of the Invention
[0006] The purpose of this invention is to propose a social robot detection method based on a multi-relational graph convolutional network, avoiding the bias and labor cost brought by manual feature extraction, and addressing the shortcomings of the new generation of robot detection solutions. The technical solution is as follows:
[0007] A social robot detection method based on a multi-relational graph convolutional network includes the following steps:
[0008] Step 1: Collect social platform user data through distributed crawlers and build a dataset;
[0009] Step 2: Extract user features based on the collected user data, including user profile features, user summary features, and user relationship features;
[0010] Step 3: Construct a multi-relationship social network graph based on the extracted user profile features, user summary features, and user relationship features;
[0011] Step 4: Based on the extracted user features and the multi-relationship social network graph, a multi-relationship graph convolutional neural network model is constructed;
[0012] Step 5: Train and test the constructed multi-relational graph convolutional neural network model.
[0013] Furthermore, the step 1 specifically includes:
[0014] Step 1.1: Develop a distributed crawler for social platforms based on the Celery asynchronous framework to collect user data. This allows for high-speed collection of user profiles, relationships, tweets, and tweet likes, reposts, comments, and replies.
[0015] Step 1.2: Invite multiple experts in the field of social robot detection to manually label the collected user data and construct a labeled real social robot dataset.
[0016] Furthermore, the distributed crawler targets the Twitter platform and includes five modules: producer, middleman, consumer cluster, IP proxy and cookie pool, and status monitor;
[0017] a) The producer is responsible for publishing periodic tasks and real-time tasks, whose task sources are user real-time demand and MongoDB database;
[0018] b) The middleman is implemented through Redis and is responsible for distributing different tasks to different task queues;
[0019] c) The consumer cluster first obtains the target task from the corresponding task queue, and selects an IP proxy and cookie from the IP proxy and cookie pool. Then, it uses a disguiser to carry the request header and required parameter information to disguise itself as a real user to avoid platform detection. After the disguise is completed, it uses a downloader to initiate a request to download page data for the target task. Finally, the parser parses and stores the downloaded page data.
[0020] d) The IP proxy and cookie pool are implemented through Redis, which is responsible for regularly maintaining the survival status of the IP proxy and cookie to ensure the resources required for crawler operation;
[0021] e) The status monitor is implemented through Celery's event monitoring mechanism and is responsible for monitoring the running status of the crawlers at each node in the consumer cluster in order to manage and maintain the crawlers.
[0022] Furthermore, the step 2 specifically includes:
[0023] Step 2.1: Extract user profile features: For user u, the number of fans, number of followers, number of tweets, and number of likes are used as numerical profile features dig u Whether it is the default profile, whether it is the default avatar, whether privacy protection is enabled, whether it has been verified, and whether there is an extended link are used as category profile features. u ;
[0024] Step 2.2: Extract user summary features: Use the TextRank algorithm to extract key content representing user behavior from user tweets, namely user summary features; for user u, its summary feature is expressed as abs u ;
[0025] Step 2.3: Extract user relationship features: Based on the collected user relationship and tweet information, extract the six types of relationships between users: follow, followed by, like, forward, comment, and reply, and put them into the edge set E.
[0026] Furthermore, the extracting of user summary features specifically includes:
[0027] Step 2.2.1: Tweet sentence embedding: For user u, all its tweets are treated as a single document and text segmented to split the text into sentences with complete meaning. That is, all tweets of user u can be represented as: T u ={s1,s2,…,s m}, where m represents the number of sentences obtained after splitting all tweets of user u, and then i Perform word segmentation and remove stop words, punctuation, numbers, and special symbols. After word segmentation, the sentence s iIt can be expressed as: i ={w1,w2,…,w n}, and finally use the pre-trained Glove word vector model to get the sentence s i The vector representation of :
[0028]
[0029] in, Represents sentence s i The pth word w after the segmentation p The word vector can be directly obtained from the Glove word vector model, n represents the sentence s i The number of words obtained after word segmentation;
[0030] The user tweet embedding is finally represented as:
[0031]
[0032] Among them, D w Represents the embedding dimension of the word vector;
[0033] Step 2.2.2: Sentence graph model construction: take sentences as nodes of the graph and use cosine similarity to calculate the vectors of two sentences and The similarity between the two sentences is the weight w of the edge between the two sentence nodes. ij , the calculation method is as follows:
[0034]
[0035] Among them, * means finding the inner product of two vectors, and |·| means finding the modulus of the vector;
[0036] Step 2.2.3: Calculate graph node weights: After calculating the weights of all edges, substitute them into the following formula to calculate the sentence weight, i.e., the node weight:
[0037]
[0038] Among them, for a sentence node v i , whose weight value is expressed as W(v i ), the sentence node pointing to the sentence node and the sentence node set pointed to by the sentence node are respectively represented as In(v i ) and Out(v i ); the coefficient d is the probability of a sentence node pointing to another sentence node, and its value is between 0 and 1; v j Points to sentence node v i Sentence node, v k For sentence node v i Pointing sentence node, wjk To connect sentence nodes v j and sentence node v k The weight of the edge between them; w ij To connect sentence nodes v i and sentence node v j The weight of the edge between them;
[0039] Step 2.2.4: User summary extraction: For the weight calculation of each sentence in the graph, i.e., the graph node, first assign an initial weight value to the corresponding graph node, then iterate the calculation according to the node weight calculation formula mentioned above until convergence; finally, all sentences are sorted according to the sentence weight value, and the top-ranked sentences are selected to form the user summary information, which is expressed as:
[0040] Furthermore, the step 3 specifically includes:
[0041] Construct a multi-relational social network graph G = (V, E), where V represents the set of all user nodes in the social network graph and E represents the set of all edges in the graph; the user node features are represented as:
[0042]
[0043] Where k is the number of user nodes, and D is the dimension of user node features;
[0044] Edges represent multiple relationships between users. Represents an edge with a relationship type of r between user node i and user node j in a social network graph.
[0045] Furthermore, the multi-relational graph convolutional neural network model in step 4 includes three modules: a feature encoding layer, a relational graph convolutional network layer, and an inference layer; specifically, as follows:
[0046] 1) Feature encoding layer: The initial representation vector of user node i in the multi-relationship network graph G is obtained by extracting user profile features and summary features:
[0047]
[0048] in, represents the profile representation vector of user node i, Represents the summary representation vector of user node i;
[0049] 2) Relationship graph convolutional neural network layer: First, the output of the feature encoding layer As the initial representation vector of the node in the Relational Graph Convolutional Network (R-GCN) layer, the multi-relational social network graph is input into the R-GCN layer, and then the representation vector of user node i is Then update it as follows:
[0050]
[0051] in, represents the set of neighbor nodes of user node i with relationship type r, c i,r is a regularization constant whose value is is a learnable parameter, the number of which is the number of edge types, σ is the relu activation function, and l represents the l-th layer R-GCN network; are learnable parameters; is the l-th layer node representation of user node j; R is the set of relationship types;
[0052] Finally, after the l-layer R-GCN network, the representation vector of user node i is obtained
[0053] 3) Reasoning layer: In the reasoning layer, the user representation vector output by the relational graph convolutional neural network layer It is input into a fully connected network for dimensionality transformation, and then the output of the fully connected layer is calculated through the Softmax function to obtain the probability that the user is a social robot.
[0054] Furthermore, the feature encoding layer extracts user profile features and summary features specifically as follows:
[0055] Step 4.1a: File feature encoding: First, the numerical file feature dig of user node i i Perform z-score normalization and input the normalized result into a fully connected neural network, and then input the category file feature cat i Input another fully connected neural network, and finally concatenate the outputs of the two fully connected networks to obtain the user profile representation vector
[0056] Step 4.1b: Summary feature encoding: First, the summary feature abs of user node i is encoded. i Use the pre-trained language model BERT to extract its semantic feature vector
[0057]
[0058] in, represents the qth summary of user node i, top represents the number of summaries generated, D s Represents the embedding dimension of the BERT model;
[0059] Then, the user summary representation vector is learned by
[0060]
[0061] Among them, W and b are learnable parameters, is the leaky-relu activation function.
[0062] Furthermore, the step 5 is specifically as follows:
[0063] Step 5.1: Dataset Splitting and Hyperparameter Setting: Split the dataset constructed in Step 1 into training, validation, and test sets in proportion, and set the number of network layers l, embedding dimension, and learning rate of the graph convolutional neural network layer;
[0064] Step 5.2: Determine the loss function: Use Focal Loss to reduce the difficulty of classifying imbalanced samples. It is calculated as follows:
[0065]
[0066] Among them, α and γ are adjustable hyperparameters; y ′ is the model prediction value, which is between (0-1). When y=1, y ′ tends to 1, indicating that it is easy to distinguish positive samples, and its contribution to the weight tends to 0; when y = 0, y ′ tends to 0, indicating that it is easy to distinguish negative samples, and its contribution to the weight tends to 0; y is the true label of the sample;
[0067] Step 5.3: Training method and evaluation metrics: First, based on the idea of GraphSAGE, the neighbors of the target node are sampled. Then, to be applicable to large-scale graph scenarios in real social network environments, a mini-batch method is used for computational training. Finally, the F1-score is used as the evaluation metric, and the validation set is verified during training. The network parameters with the best F1-score during the verification process are saved.
[0068] Compared with the prior art, the present invention has the following beneficial effects:
[0069] 1) This invention uses archive metadata and a neural network model to extract the initial representation vector of a node, thus avoiding the bias and labor cost of manual feature extraction.
[0070] 2) This invention discovers the user's true behavioral intention by extracting user summaries, which makes up for the shortcomings of the new generation of robot detection solutions;
[0071] 3) This paper constructs a multi-relational social network graph based on a real network environment, taking into account the different influence strengths of different types of edges on neighborhoods, and effectively represents users in a real network environment by combining user profiles and user summary features;
[0072] 4) The social robot detection method proposed in this paper supports the expansion of more edge types, samples the neighbors of the target node based on the idea of GraphSAGE, and uses a mini-batch method for calculation. At the same time, the FocalLoss loss function takes into account the imbalanced sample problem. It is suitable for real social network environments with huge graphs and an unbalanced ratio of robots and humans. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 This is a flow chart of a social robot detection method based on a multi-relational graph convolutional network in an embodiment of the present invention.
[0074] Figure 2 2 is a diagram of a distributed crawler framework for the Twitter platform developed in an embodiment of the present invention.
[0075] Figure 3 Schematic diagram of a multi-relationship social network in an embodiment of the present invention.
[0076] Figure 4 4 is a flowchart of user summary feature extraction in an embodiment of the present invention. DETAILED DESCRIPTION
[0077] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0078] The social robot detection method based on multi-relationship graph convolutional network proposed in the present invention is an improvement on traditional machine learning, deep learning and graph theory methods. First, the user is preliminarily characterized from the two dimensions of user profile and user summary, the user attributes are preliminarily characterized from the user profile dimension, and the true intention of the user behavior is discovered from the user summary dimension. Then, based on the real social network environment, users are used as nodes and the relationships between users as edges to construct a multi-relationship social network graph, and the R-GCN network is used to model the different influence strengths of different types of neighbors on the target user. The user profile features and user summary features are combined to achieve effective characterization of user nodes, which solves the problem that the current detection method is insufficient in user representation and cannot detect the new generation of social robots. Finally, accurate detection of robots in a real social network environment is achieved.
[0079] like Figure 1As shown, in combination with specific embodiments, the social robot detection method based on multi-relational graph convolutional network proposed in the present invention is specifically implemented as follows:
[0080] Step 1: Develop a distributed crawler for the Twitter platform to collect user data and build a dataset.
[0081] 1) Develop a distributed crawler for Twitter platform based on Celery asynchronous framework to collect user data, and achieve high-speed collection of user profiles, relationships, tweets, and tweet likes, reposts, comments, replies, etc. Figure 2 As shown, the crawler can be divided into five modules: producer, middleman, consumer cluster, IP proxy and cookie pool, and status monitor.
[0082] a) Producers are responsible for publishing periodic tasks and real-time tasks, whose task sources are real-time user needs and MongoDB databases;
[0083] b) The middleman is implemented through Redis and is responsible for distributing different tasks to different task queues;
[0084] c) The consumer cluster first obtains the target task from the corresponding task queue and selects an IP proxy and cookie from the IP proxy and cookie pool. Then, it uses a disguiser to disguise itself as a real user by carrying the request header, required parameters, and other information to avoid platform detection. After the disguise is completed, it uses a downloader to initiate a request to download page data for the target task. Finally, the parser parses and stores the downloaded page data.
[0085] d) The IP proxy and cookie pool are also implemented through Redis, which is responsible for regularly maintaining the survival status of the IP proxy and cookies to ensure the resources required for crawler operation;
[0086] e) The status monitor is implemented through Celery's event monitoring mechanism, which is responsible for monitoring the running status of the crawlers on each node of the consumer cluster, facilitating the management and maintenance of the crawlers.
[0087] 2) We invited multiple experts in social bot detection to manually annotate the collected user data, constructing a labeled dataset of real social bots. Specifically, three experts manually annotated the data, and the final annotation results were determined by voting.
[0088] Step 2: Extract features based on the collected user data, including user profile features, user summary features, and user relationship features.
[0089] 1) User profile features: Robot users and human users show significant differences in profile completeness, personalization, and consistency. To reduce human bias and labor costs in feature extraction, profile metadata with discriminativeness is used as user profile features. Specifically, for user u, the number of fans, number of followings, number of tweets, and number of likes are used as numerical profile features. u Whether it is the default profile, whether it is the default avatar, whether privacy protection is enabled, whether it has been verified, and whether there is an extended link are used as category profile features. u .
[0090] 2) User Summary Features: Bot accounts performing malicious tasks often post irrelevant information to avoid platform bans. To better assess user behavior, it is necessary to filter out this irrelevant information and identify the textual content that truly represents the user's behavioral intent. Therefore, this paper uses the TextRank algorithm to extract key content representative of user behavior, namely user summary features, from a large number of user tweets.
[0091] like Figure 4 As shown in Figure 2, the user summary feature extraction process is as follows:
[0092] a) Tweet sentence embedding: For user u, all its tweets are treated as a single document and text segmented to split the text into sentences with complete meanings. That is, all tweets of user u can be represented as: T u ={s1,s2,…,s m}, where m represents the number of sentences obtained after splitting all tweets of user u, and then i Perform word segmentation and remove stop words, punctuation, numbers, and special symbols, that is, the sentence after word segmentation s i It can be expressed as: i ={w1,w2,…,w n}, and finally use the pre-trained Glove word vector model to get the sentence s i The vector representation of :
[0093]
[0094] in, Represents sentence s i The pth word w after the segmentation p The word vector can be directly obtained from the Glove word vector model, n represents the sentence s i The number of words obtained after word segmentation. The user tweet embedding is finally expressed as D w Represents the embedding dimension of the word vector, here we take D w =100.
[0095] b) Sentence graph model construction, using sentences as nodes of the graph and using cosine similarity to calculate the vectors of two sentences and The similarity between them is the weight w of the edge between the two points ij , the calculation method is as follows:
[0096]
[0097] Among them, * means finding the inner product of two vectors, and |·| means finding the modulus of the vector.
[0098] c) Calculate the graph node weights. After calculating the weights of all edges, substitute them into the following formula to calculate the sentence weight, i.e., the node weight:
[0099]
[0100] Among them, for a sentence node v i , whose weight value is expressed as W(v i ), the sentence node pointing to the sentence node and the sentence node set pointed to by the sentence node are respectively represented as In(v i ) and Out(v i ); The coefficient d is the probability of a sentence node pointing to another sentence node, and its value is between 0 and 1. Here it is assigned to 0.85. j Points to sentence node v i Sentence node, v k For sentence node v i Pointing sentence node, w jk To connect sentence nodes v j and sentence node v k The weight of the edge between them; w ij To connect sentence nodes v i and sentence node v j The weight of the edge between them.
[0101] d) User summary extraction: For the weight calculation of each sentence in the graph, first assign an initial weight value to the corresponding graph node, and then iterate the calculation according to the above formula until convergence. Finally, all sentences are sorted according to the sentence weight value, and the top sentences are selected to form the user summary information, which is expressed as Here we set top=5.
[0102] 3) User Relationship Characteristics: In addition to the two explicit relationships of following and being followed, social network users can also extract four interactive relationships based on their tweets: likes, retweets, comments, and replies. Considering the varying influence of different types of relationships between users, this paper extracts these six relationships from the collected user relationships and tweet information and places them into an edge set E, which includes six types of edges (|E| = 6): following, being followed, likes, retweets, comments, and replies.
[0103] Step 3: Based on the extracted user features and relationship features, a multi-relationship social network graph is constructed.
[0104] Based on the user features and relationship features extracted in step 2, such as Figure 3 As shown, a multi-relational social network graph G = (V, E) is constructed, where V represents the set of all nodes in the graph and E represents the set of all edges in the graph. Nodes represent users in the social network, and node features can be expressed as Where k is the number of nodes and D is the dimension of node features. Edges represent multiple relationships between users. Represents an edge with a relationship type of r between user node i and user node j in the graph.
[0105] Step 4: Based on the extracted user features and the multi-relationship social network graph, a multi-relationship graph convolutional neural network model is constructed.
[0106] The model proposed in this paper mainly includes three modules: feature encoding layer, relationship graph convolutional network layer and reasoning layer:
[0107] 1) Feature encoding layer: Obtain the initial representation vector of user node i in the multi-relationship network graph G through the extracted user profile features and summary features in represents the profile representation vector of user node i, Denotes the summary representation vector of user node i, where D=128.
[0108] a) File feature encoding: First, the numerical file feature dig of user node i is encoded. i Perform z-score normalization and input the normalized result into a fully connected neural network. Then, the category profile feature cat i Input another fully connected neural network, and finally concatenate the outputs of the two fully connected networks to obtain the user profile representation vector
[0109] b) Summary feature encoding: First, the summary feature abs of user node i is encoded. i Use the pre-trained language model BERT to extract its semantic feature vector
[0110]
[0111] in, represents the qth summary of user node i, top represents the number of summaries generated, D s Represents the embedding dimension of the BERT model.
[0112] Then, the user summary representation vector is learned by
[0113]
[0114] Among them, W and b are learnable parameters, is the leaky-relu activation function.
[0115] 2) Relational Graph Convolutional Network (R-GCN): R-GCN uses different weights for different types of edges to learn the different influences of different types of edges on the neighborhood. As the initial representation vector of the node in R-GCN, the multi-relational social network graph constructed in step 3 is input into R-GCN, and then the representation vector of node i Then update it as follows:
[0116]
[0117] in, represents the set of neighbor nodes of node i with relationship type r, c i,r is a regularization constant whose value is It is a learnable parameter, the number of which is the number of edge types, σ is the relu activation function, and l represents the l-th layer R-GCN network, which can be set by yourself. are learnable parameters; is the l-th layer node representation of user node j; R is the relationship type set.
[0118] Finally, after the l-layer R-GCN network, the representation vector of user node i is obtained
[0119] 3) Inference layer: In the inference layer, the user representation vector output by the R-GCN layer It is input into a fully connected network for dimensionality transformation, and then the output of the fully connected layer is calculated through the Softmax function to obtain the probability that the user is a social robot.
[0120] Step 5: Train and test the constructed multi-relational graph convolutional neural network model.
[0121] 1) Dataset Splitting and Hyperparameter Setting: The dataset constructed in step 1 is split into training, validation, and test sets in a ratio of 7:2:1. The number of R-GCN network layers l is set to 2, the embedding dimension is set to 128, the Adam optimizer is used, and the learning rate is set to 0.001.
[0122] 2) Loss function: Considering the imbalance between the proportion of social robots and human users in real network environments, this paper uses FocalLoss loss to reduce the difficulty of classifying unbalanced samples. Its calculation method is as follows:
[0123]
[0124] Where α and γ are adjustable hyperparameters, set α = 0.25, γ = 2. ′ is the model prediction value, which is between (0-1). When y=1, y ′ tends to 1, indicating that it is easy to distinguish positive samples, and its contribution to the weight tends to 0; when y = 0, y ′ It tends to 0, indicating that it is easy to distinguish negative samples, and its contribution to the weight tends to 0; y is the true label of the sample.
[0125] 3) Training Method and Evaluation Metrics: First, based on the idea of GraphSAGE, the neighbors of the target node are sampled for three iterations (sampling three-hop neighbors), with 128 neighbors sampled in each iteration. Then, to be suitable for large-scale graph scenarios in real social network environments, a mini-batch approach is used for computational training, with the batch size (Batch Size) set to 128 and the epoch (Epoch) set to 50. Finally, the F1-score is used as the evaluation metric, and the validation set is verified during the training process. The network parameters with the best F1-score during the verification process are saved for subsequent testing using the saved network parameters.
Claims
1. A social robot detection method based on multi-relational graph convolutional network, characterized by: The following steps are involved: Step 1: Collect social platform user data through distributed crawlers and build a dataset; Step 2: Extract user features based on the collected user data, including user profile features, user summary features, and user relationship features; Step 3: Construct a multi-relationship social network graph based on the extracted user profile features, user summary features, and user relationship features; Step 4: Based on the extracted user features and the multi-relationship social network graph, a multi-relationship graph convolutional neural network model is constructed; Step 5: Train and test the constructed multi-relational graph convolutional neural network model; The step 2 specifically includes: Step 2.1: Extract user profile features: For user u, the number of fans, number of followers, number of tweets, and number of likes are used as numerical profile features dig u Whether it is the default profile, whether it is the default avatar, whether privacy protection is enabled, whether it has been verified, and whether there is an extended link are used as category profile features. u ; Step 2.2: Extract user summary features: Use the TextRank algorithm to extract key content representing user behavior from user tweets, namely user summary features; for user u, its summary feature is expressed as abs u ; Step 2.3: Extract user relationship features: Based on the collected user relationship and tweet information, extract the six types of relationships between users: follow, followed by, like, forward, comment, and reply, and put them into the edge set E; The extracting of user summary features specifically includes: Step 2.2.1: Tweet sentence embedding: For user u, all its tweets are treated as a single document and text segmented to split the text into sentences with complete meaning. That is, all tweets of user u are represented as: T u ={s1,s2,…,s m }, where m represents the number of sentences obtained after splitting all tweets of user u; then for sentence s i Perform word segmentation and remove stop words, punctuation, numbers, and special symbols. After word segmentation, the sentence s i Expressed as: s i ={w1,w2,…,w n }; Finally, use the pre-trained Glove word vector model to get the sentence s i The vector representation of : in, Represents sentence s i The pth word w after the segmentation p The word vector is directly obtained from the Glove word vector model, n represents the sentence s i The number of words obtained after word segmentation; The user tweet embedding is finally represented as: Among them, D w Represents the embedding dimension of the word vector; Step 2.2.2: Sentence graph model construction: take sentences as nodes of the graph and use cosine similarity to calculate the vectors of two sentences and The similarity between the two sentences is the weight w of the edge between the two sentence nodes. ij , the calculation method is as follows: Among them, * means finding the inner product of two vectors, and |·| means finding the modulus of the vector; Step 2.2.3: Calculate graph node weights: After calculating the weights of all edges, substitute them into the following formula to calculate the sentence weight, i.e., the node weight: Among them, for a sentence node v i , whose weight value is expressed as W(v i ), the sentence node pointing to the sentence node and the sentence node set pointed to by the sentence node are respectively represented as In(v i ) and Out(v i ); the coefficient d is the probability of a sentence node pointing to another sentence node, and its value is between 0 and 1; v j Points to sentence node v i Sentence node, v k For sentence node v i Pointing sentence node, w jk To connect sentence nodes v j and sentence node v k The weight of the edge between them; w ij To connect sentence nodes v i and sentence node v j The weight of the edge between them; Step 2.2.4: User summary extraction: For the weight calculation of each sentence in the graph, i.e., the graph node, first assign an initial weight value to the corresponding graph node, then iterate the calculation according to the node weight calculation formula mentioned above until convergence; finally, all sentences are sorted according to the sentence weight value, and the top-ranked sentences are selected to form the user summary information, which is expressed as:
2. The social robot detection method based on multi-relational graph convolutional network according to claim 1 is characterized in that: The step 1 specifically includes: Step 1.1: Develop a distributed crawler for social platforms based on the Celery asynchronous framework to collect user data. This allows for high-speed collection of user profiles, relationships, tweets, and tweet likes, reposts, comments, and replies. Step 1.2: Invite multiple experts in the field of social robot detection to manually label the collected user data and construct a labeled real social robot dataset.
3. The social robot detection method based on multi-relational graph convolutional network according to claim 1 is characterized in that: The distributed crawler targets the Twitter platform and includes five modules: producer, middleman, consumer cluster, IP proxy and cookie pool, and status monitor. a) The producer is responsible for publishing periodic tasks and real-time tasks, whose task sources are user real-time demand and MongoDB database; b) The middleman is implemented through Redis and is responsible for distributing different tasks to different task queues; c) The consumer cluster first obtains the target task from the corresponding task queue, and selects an IP proxy and cookie from the IP proxy and cookie pool. Then, it uses a disguiser to carry the request header and required parameter information to disguise itself as a real user to avoid platform detection. After the disguise is completed, it uses a downloader to initiate a request to download page data for the target task. Finally, the parser parses and stores the downloaded page data. d) The IP proxy and cookie pool are implemented through Redis, which is responsible for regularly maintaining the survival status of the IP proxy and cookie to ensure the resources required for crawler operation; e) The status monitor is implemented through Celery's event monitoring mechanism and is responsible for monitoring the running status of the crawlers at each node in the consumer cluster in order to manage and maintain the crawlers.
4. The social robot detection method based on multi-relational graph convolutional network according to claim 1 is characterized in that: The step 3 specifically includes: Construct a multi-relational social network graph G = (V, E), where V represents the set of all user nodes in the social network graph and E represents the set of all edges in the graph; the user node features are represented as: Where k is the number of user nodes, and D is the dimension of user node features; Edges represent multiple relationships between users. Represents an edge with a relationship type of r between user node i and user node j in a social network graph.
5. The social robot detection method based on multi-relational graph convolutional network according to claim 4 is characterized in that: The multi-relational graph convolutional neural network model in step 4 includes three modules: a feature encoding layer, a relational graph convolutional network layer, and an inference layer; the details are as follows: 1) Feature encoding layer: The initial representation vector of user node i in the multi-relationship network graph G is obtained by extracting user profile features and summary features: in, represents the profile representation vector of user node i, Represents the summary representation vector of user node i; 2) Relationship graph convolutional neural network layer: First, the output of the feature encoding layer As the initial representation vector of the node in the relationship graph convolutional neural network layer, the multi-relational social network graph is input into the R-GCN layer, and then the representation vector of user node i Then update it as follows: in, represents the set of neighbor nodes of user node i with relationship type r, c i,r is a regularization constant whose value is is a learnable parameter, the number of which is the number of edge types, σ is the relu activation function, and l represents the l-th layer R-GCN network; are learnable parameters; is the l-th layer node representation of user node j; R is the set of relationship types; Finally, after the l-layer R-GCN network, the representation vector of user node i is obtained 3) Reasoning layer: In the reasoning layer, the user representation vector output by the relational graph convolutional neural network layer It is input into a fully connected network for dimensionality transformation, and then the output of the fully connected layer is calculated through the Softmax function to obtain the probability that the user is a social robot.
6. The social robot detection method based on multi-relational graph convolutional network according to claim 5 is characterized in that: The feature coding layer extracts user profile features and summary features specifically as follows: Step 4.1a: File feature encoding: First, the numerical file feature dig of user node i i Perform z-score normalization and input the normalized result into a fully connected neural network, and then input the category file feature cat i Input another fully connected neural network, and finally concatenate the outputs of the two fully connected networks to obtain the user profile representation vector Step 4.1b: Summary feature encoding: First, the summary feature abs of user node i is encoded. i Use the pre-trained language model BERT to extract its semantic feature vector in, represents the qth summary of user node i, top represents the number of summaries generated, D s Represents the embedding dimension of the BERT model; Then, the user summary representation vector is learned by Among them, W and b are parameters that can be learned, is the leaky-relu activation function.
7. The social robot detection method based on multi-relational graph convolutional network according to claim 1 is characterized in that: The step 5 is specifically as follows: Step 5.1: Dataset Splitting and Hyperparameter Setting: Split the dataset constructed in Step 1 into training, validation, and test sets in proportion, and set the number of network layers l, embedding dimension, and learning rate of the graph convolutional neural network layer; Step 5.2: Determine the loss function: Use Focal Loss to reduce the difficulty of classifying imbalanced samples. It is calculated as follows: Among them, α and γ are hyperparameters that can be adjusted; y ′ is the model prediction value, which is between 0 and 1. When y=1, y ′ tends to 1, indicating that it is easy to distinguish positive samples, and its contribution to the weight tends to 0; when y = 0, y ′ tends to 0, indicating that it is easy to distinguish negative samples, and its contribution to the weight tends to 0, and y is the true label of the sample; Step 5.3: Training method and evaluation metrics: First, based on the idea of GraphSAGE, the neighbors of the target node are sampled. Then, to be applicable to large-scale graph scenarios in real social network environments, a mini-batch method is used for computational training. Finally, the F1-score is used as the evaluation metric, and the validation set is verified during training. The network parameters with the best F1-score during the verification process are saved.
Citation Information
Patent Citations
Method for establishing word vector improved model based on semantic embedding
CN110532395A
Cantonese rumor detection method based on deep semantic perception graph convolutional network
CN114444516A