Malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution
The bidirectional feature-enhanced heterogeneous graph convolutional network model combined with the text encoding of the LaBSE model solves the problem of detecting malicious social robots in social networks, achieves accurate identification and detection of malicious social robots, and improves the accuracy and robustness of detection. sex.
Patent Information
- Application Number
- CN202410973276.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-19
AI Technical Summary
Existing graph-based social robot detection methods are difficult to capture the directionality and dynamic changes of interactive relationships in social networks, making it more difficult to detect malicious social robots. They also have strong camouflage capabilities and are difficult to identify.
A bidirectional feature-enhanced heterogeneous graph convolutional network model is used to encode the original text content through the LaBSE model. Combined with the social relationship network matrix, a bidirectional feature-enhanced heterogeneous graph convolutional network model is constructed. A gradient penalty term is introduced to improve robustness and achieve malicious intent. Social bot detection.
It effectively captures the directionality and interactivity of interactive relationships in social networks, accurately identifies normal users and malicious social robots, improves detection accuracy and robustness, and reduces over-fitting phenomena.
Smart Images

Figure CN118520868B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of social robot detection, and specifically relates to a malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution. Background Art
[0002] Social robots are virtual accounts controlled by computer programs or artificial intelligence technology. They can automatically generate and publish content in social networks, and can also simulate human user behavior to interact with real users. Some social robots in social networks can help humans analyze and process massive amounts of data, reduce human workload, and improve work efficiency. However, due to the openness of social networks and the extremely fast speed of information dissemination, more and more social robots with malicious purposes have emerged. These social robots are used to perform various malicious activities, such as misleading, deceiving or manipulating users and content in social networks, and are also used to spread false information, spread rumors, and even commit fraud and cyber attacks, thus posing a threat to the security of the social environment. These malicious behaviors undermine the health of cyberspace and threaten user information security and privacy. Therefore, identifying malicious social robots is crucial to maintaining public interests and promoting the healthy development of the network environment.
[0003] Although some progress has been made in detecting malicious social robots, due to the continuous innovation of social robot technology, the new generation of social robots has stronger disguise capabilities. They can evade detection in many ways, such as modifying account information, imitating real user behavior, and forming interactive social circles, making their behavior increasingly similar to normal users, increasing the difficulty of detection. In addition, existing graph-based social robot detection methods often ignore the directionality and dynamic changes of interactive relationships in social networks, while social robots show significant differences in different interactive relationships, such as fewer replies and one-way interactions. Summary of the invention
[0004] The purpose of the present invention is to provide a malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution, which can effectively capture the directionality and interactivity of interactive relationships in social networks and accurately identify normal users and malicious social robots in social networks.
[0005] The technical solution adopted by the present invention is a malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution, which specifically includes the following steps:
[0006] Step 1: Extract the social relationship network matrix formed in the interaction process through the content posted by users, and extract the original text content posted by users;
[0007] Step 2: Encode the original text content through the LaBSE model to obtain the final user text feature vector;
[0008] Step 3: Build a bidirectional feature enhanced heterogeneous graph convolutional network model and train it;
[0009] Step 4: Input the social relationship network matrix into the trained bidirectional feature enhanced heterogeneous graph convolutional network model to obtain the overall node features;
[0010] Step 5: Apply linear transformation to the final user text feature vector and then fuse the overall node features to obtain the malicious social robot detection results.
[0011] The present invention is also characterized in that:
[0012] Step 2 encodes the original text content through the LaBSE model to obtain the final text feature vector. The specific steps include:
[0013] Step 2.1: Extract each user’s original text content text sequence , represents a text sequence of a user, Indicates the first i sentences, among which , n Indicates the total number of sentences contained in the original text content;
[0014] Step 2.2: Use the LaBSE model to classify sentences in the text content Perform embedding calculation to get the sentence The corresponding text feature vector , expressed as:
[0015] (1)
[0016] In the formula, and are the weight matrix and bias vector in the LaBSE model;
[0017] Step 2.3: LaBSE model for sentence The corresponding text feature vector Introducing a language embedding weight , which means the sentence The language it belongs to, expressed as:
[0018] (2);
[0019] (3)
[0020] In the formula, is a hyperparameter used to control the similarity calculation, Expressing sentences With sentence The corresponding text feature vector The similarity between Expressing sentences and language The text feature vector The similarity between N Indicates the type of language;
[0021] Step 2.4: Translate the sentences The corresponding text feature vector Integration to obtain the user's text feature vector , the final user text feature vector is calculated through the fully connected layer and the activation function PReLU ,in represents the feature embedding dimension matrix, Dim The row representing the feature embedding dimension matrix is 256; the final user text feature vector calculation formula is as follows:
[0022] (4)
[0023] In the formula, Represents the activation function PReLU.
[0024] Step 3 specifically includes the following steps:
[0025] Step 3.1: Construct the feature-enhanced heterogeneous network layer EHGT;
[0026] After linear transformation of the node features obtained in the network layer of the heterogeneous graph convolutional neural network HGT, the GELU activation function is used for activation, and an additional linear transformation is performed again to obtain the enhanced feature nodes. The enhanced feature nodes and the original feature nodes are weighted to obtain the EHGT output of the target node. The calculation process is expressed as:
[0027] (5)
[0028] In the formula, Represents the parameters for weight transformation of enhanced feature nodes and original feature nodes, which are scaled to the range [0,1] by Sigmoid; W lin is the weight of the linear transformation, W enhance is the weight of the additional linear transformation, represents the GELU activation function, Indicates the target node In the The EHGT output of the layer, Indicates the target node In the HGT output of the layer;
[0029] Step 3.2: Construct a bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT;
[0030] The bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT contains two layers of feature enhanced heterogeneous network layers EHGT, namely the forward propagation EHGT network layer and the backward propagation EHGT network layer, which learn the social network structure forward and backward respectively;
[0031] The forward propagation EHGT network layer calculation process is as follows:
[0032] (6);
[0033] (7)
[0034] In the formula, Indicates the target node In the HGT forward output of the layer; b Represents the source node, e represents the forward propagation relationship between nodes, Represents aggregation, Represents a collection of nodes, represents the attention calculation of the convolutional layer of the HGT heterogeneous network, Represents the information transfer calculation of the convolutional layer of the HGT heterogeneous network; and They represent the target nodes in the forward propagation process. In the Layer and HGT output of the layer; Represents the target node in the forward propagation process No. EHGT output of the layer;
[0035] The calculation process of the EHGT network layer for backward propagation is as follows:
[0036] (8);
[0037] (9)
[0038] In the formula, represents the back propagation relationship between nodes, and They represent the target nodes in the backward propagation process. In the Layer and HGT output of the layer; Represents the target node in the backward propagation process No. EHGT output of the layer;
[0039] Step 3.3: Train the constructed bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT, and introduce the gradient penalty term into the cross entropy loss function during the training process In, it is expressed as:
[0040] (10)
[0041] In the formula, is the loss function that introduces the gradient penalty term, It is m The true label of each user, The model is m The prediction results for each user, represents the trainable model parameters, is the L2 norm, is the weight of the gradient penalty term, M is the number of users in the training set;
[0042] Cross Entropy Loss Function and Trainable Model Parameters gradient The calculation is expressed as:
[0043] (11)
[0044] In the formula, L is the iterative cross entropy loss function during training, It means k Parameters for round model training.
[0045] Step 4 specifically includes the following steps:
[0046] Step 4.1: Embed the social relationship network matrix into the forward propagation EHGT network layer, and obtain the forward propagation node features through the forward propagation process , expressed as:
[0047] (12)
[0048] In the formula, , is the weight matrix obtained by the system through parameter training, Represents the GELU activation function operation, Represents the target node in the forward propagation process No. EHGT output of the layer;
[0049] Step 4.2: The social relationship network matrix between users is passed through the EHGT network layer to obtain the node features of the backpropagation. , expressed as:
[0050] (13)
[0051] In the formula, , is the weight matrix obtained by the system through parameter training, Represents the GELU activation function operation, Represents the target node in the backward propagation process No. EHGT output of the layer;
[0052] Step 4.3: Connect the node features of the forward propagation and the node features of the backward propagation to obtain the overall node features x , expressed as:
[0053] (14)
[0054] In the formula, represents the connection function, is the weight matrix, represents the node features propagated forward, Represents the node features for backward propagation.
[0055] In step 5, a linear transformation is applied to the final user text feature vector, expressed as:
[0056] (15)
[0057] In the formula, represents the final user text feature vector after linear transformation, represents the final user text feature vector, is the weight matrix, is a variable parameter, Represents the activation function operation.
[0058] Step 5: Malicious social robot detection result, expressed as:
[0059] (16)
[0060] In the formula, y Represents the malicious social robot detection result, is the weight matrix, represents the connection function operation, represents the final user text feature vector after linear transformation, is a variable parameter,x Represents the overall node characteristics.
[0061] The beneficial effects of the present invention are:
[0062] 1. The malicious social robot detection method of the present invention is based on bidirectional feature enhanced heterogeneous graph convolution, which introduces a feature enhancement module into the heterogeneous neural network to improve the network's modeling effect on heterogeneous properties and complex relationships, and better capture the rich information in social networks.
[0063] 2. The present invention is based on a malicious social robot detection method based on bidirectional feature-enhanced heterogeneous graph convolution, and constructs a feature-enhanced bidirectional heterogeneous network model. This model effectively captures the directionality and interactivity of interactive relationships in social networks, and accurately identifies the behavioral differences between normal users and malicious social robots in social networks.
[0064] 3. The malicious social robot detection method of the present invention is based on bidirectional feature enhanced heterogeneous graph convolution, and introduces a gradient penalty term in the cross entropy loss function to improve the robustness of the model and prevent overfitting. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a flow chart of a malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution of the present invention;
[0066] Figure 2 It is a structural diagram of the BI-EHGT model in the malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution of the present invention;
[0067] Figure 3 This is a comparison chart of the detection results of the model of the method of the present invention and other graph convolution models on the data set. DETAILED DESCRIPTION
[0068] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0069] Malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution, such as Figure 1 As shown, the specific steps include:
[0070] Step 1: Extract the social relationship network matrix formed in the interaction process through the content posted by users, and extract the original text content posted by users;
[0071] The social relationship network matrix includes the interactive behaviors of users in the published content. Following, being followed, mentioning each other, replying to information and quoting between users are explicit relationships, and these social relationships can be directly constructed from the interaction of users. In addition to explicit social relationships, two implicit relationships are proposed, namely URL co-occurrence and topic co-occurrence, that is, the social interaction of users under the same topic or link. The method of the present invention focuses on detecting malicious social robots, so five interactive relationships formed by users' mentions, forwarding, quoting and agreeing topics and links in the published content are selected. By analyzing the directed relationships between users and the interactions with other entities, malicious behaviors in social networks can be more deeply understood. These interactive relationships formed by publishing content effectively reflect the connection and communication patterns between users, and can reveal potential malicious behavior patterns, such as abnormal interaction frequency, automated mentions, etc., thereby helping to improve the model's recognition accuracy of malicious social robots.
[0072] Original text content contains individual user's thoughts, opinions and emotions. Deep mining of original text content posted by users can not only provide a deep understanding of users' unique characteristics, but also provide multi-dimensional information for the model, enabling it to more accurately identify user behavior in social networks and comprehensively capture users' unique language style, topic preferences, emotional tendencies and other important information.
[0073] Step 2: Encode the original text content through the LaBSE model to obtain the final user text feature vector.
[0074] Users on social platforms have specific cross-border characteristics, resulting in language diversity in original text content. In order to prevent malicious social robots from evading detection by changing languages, the method of the present invention uses a pre-trained model LaBSE (Language-agnostic BERT Sentence Embedding) to encode text, which generates language-agnostic cross-language sentence embeddings for 109 languages on a single model. Simply put, LaBSE combines MLM and TLM pre-training on a 12-layer transformer. LaBSE is a language-independent BERT sentence embedding model that can encode texts in different languages into a shared embedding space, so it is more suitable for processing multilingual text information. Using a dual encoder architecture, the source text and the target text are encoded using a shared parameter converter embedding vector network respectively, and a translation ranking task is applied to force the texts that interpret each other to have similar expressions. The converter embedding vector network is initialized from a BERT checkpoint trained on MLM and TLM tasks. In this way, when a malicious social robot attempts to change language, its text information can still be mapped to a similar embedding space, which helps to more reliably identify potential bad behavior.
[0075] The method of the present invention encodes the original text content through the LaBSE model, and the specific process is as follows:
[0076] Step 2.1: Extract each user’s original text content text sequence , represents a text sequence of a user, Indicates the first i sentences, among which , n Indicates the total number of sentences contained in the original text content;
[0077] Step 2.2: Use the LaBSE model to classify sentences in the text content Perform embedding calculation to get the sentence The corresponding text feature vector , expressed as:
[0078] (1)
[0079] In the formula, and are the weight matrix and bias vector in the LaBSE model;
[0080] Step 2.3: LaBSE model for sentence The corresponding text feature vector Introducing a language embedding weight , which means the sentence The language it belongs to, expressed as:
[0081] (2);
[0082] (3)
[0083] In the formula, is a hyperparameter used to control the similarity calculation, Expressing sentences With sentence The corresponding text feature vector The similarity between Expressing sentences and language The text feature vector The similarity between N Indicates the type of language; the above similarities are all obtained by the cosine similarity formula.
[0084] Step 2.4: Translate the sentences The corresponding text feature vector Integration to obtain the user's text feature vector , the final user text feature vector is calculated through the fully connected layer and the activation function PReLU ,in represents the feature embedding dimension matrix, Dim The row representing the feature embedding dimension matrix is 256; the final user text feature vector calculation formula is as follows:
[0085] (4)
[0086] In the formula, Represents the activation function PReLU.
[0087] Step 3: Build a bidirectional feature enhanced heterogeneous graph convolutional network model and train it;
[0088] In order to effectively process multi-type entities and complex relationship structures in social relationship networks, a heterogeneous graph convolutional neural network model HGT (Heterogeneous Graph Transformer) is used. The HGT model uses meta-path to decompose the interaction information and transfer matrix between nodes and edges, and uses the heterogeneous mutual attention mechanism to effectively summarize and process information between different types of nodes. This method enables the model to more flexibly capture the relationship between different types of nodes and edges in heterogeneous networks.
[0089] The specific steps include:
[0090] Step 3.1: Construct the feature-enhanced heterogeneous network layer EHGT;
[0091] In order to improve the performance of heterogeneous convolutional neural networks and expand the adaptability of tasks, a feature enhancement module is introduced. Feature enhancement improves the information richness of features, allowing the network to capture data structures and patterns more comprehensively and diversely. Specifically, the node features obtained in the network layer of the heterogeneous graph convolutional neural network HGT are linearly transformed and activated using the GELU activation function, and then additional linear transformations are performed to obtain enhanced feature nodes. The enhanced feature nodes and the original feature nodes are weighted to obtain the EHGT output of the target node. The calculation process is expressed as:
[0092] (5)
[0093] In the formula, Represents the parameters for weight transformation of enhanced feature nodes and original feature nodes, which are scaled to the range [0,1] by Sigmoid; W lin is the weight of the linear transformation, W enhance is the weight of the additional linear transformation, represents the GELU activation function, Indicates the target node In the The EHGT output of the layer, Indicates the target node In the HGT output of the layer;
[0094] This module introduces nonlinearity and additional linear transformations to make the network more adaptable to complex graph structures and node features.
[0095] Step 3.2: Construct a bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT;
[0096] The bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT includes two layers of feature enhanced heterogeneous network layers EHGT, namely the forward propagation EHGT network layer and the backward propagation EHGT network layer, which respectively learn the social network structure forward and backward, such as Figure 2 As shown;
[0097] The forward-EHGT network layer is calculated as follows:
[0098] (6);
[0099] (7)
[0100] In the formula, Indicates the target node In the HGT forward output of the layer; b Represents the source node, e represents the forward propagation relationship between nodes, Represents aggregation, Represents a collection of nodes, represents the attention calculation of the convolutional layer of the HGT heterogeneous network, Represents the information transfer calculation of the convolutional layer of the HGT heterogeneous network; and They represent the target nodes in the forward propagation process. In the Layer and HGT output of the layer; Represents the target node in the forward propagation process No. EHGT output of the layer;
[0101] The backward-EHGT network layer is calculated as follows:
[0102] (8);
[0103] (9)
[0104] In the formula, represents the back propagation relationship between nodes, and They represent the target nodes in the backward propagation process. In the Layer and HGT output of the layer; Represents the target node in the backward propagation process No. EHGT output of the layer;
[0105] Step 3.3: Train the constructed bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT, and introduce the gradient penalty term into the cross entropy loss function during the training process In , the purpose is to prevent excessive fluctuations in model parameters by regularizing the gradients of model parameters, thereby improving the stability and generalization ability of the model. The overall loss function is expressed as:
[0106] (10)
[0107] In the formula, is the loss function that introduces the gradient penalty term, It is m The true label of each user, The model is m The prediction results for each user, represents the trainable model parameters, is the L2 norm, is the weight of the gradient penalty term, M is the number of users in the training set;
[0108] The method of the present invention uses the loss to calculate the gradient relative to the model parameters, and uses back propagation to calculate the gradient of the loss relative to the model parameters. Finally, the loss is calculated by the output of the model and the true label to measure the gap between the model's prediction and the actual label.
[0109] Cross Entropy Loss Function and Trainable Model Parameters gradient The calculation is expressed as:
[0110] (11)
[0111] In the formula, L is the iterative cross entropy loss function during training, It means kParameters for round model training.
[0112] Step 4: Input the social relationship network matrix into the trained bidirectional feature enhanced heterogeneous graph convolutional network model to obtain the overall node features;
[0113] The specific steps include:
[0114] Step 4.1: Embed the social relationship network matrix into the forward propagation EHGT network layer, and obtain the forward propagation node features through the forward propagation process , expressed as:
[0115] (12)
[0116] In the formula, , is the weight matrix obtained by the system through parameter training, Represents the GELU activation function operation, Represents the target node in the forward propagation process No. EHGT output of the layer;
[0117] Step 4.2: The social relationship network matrix between users is passed through the EHGT network layer to obtain the node features of the backpropagation. , expressed as:
[0118] (13)
[0119] In the formula, , is the weight matrix obtained by the system through parameter training, Represents the GELU activation function operation, Represents the target node in the backward propagation process No. EHGT output of the layer;
[0120] Step 4.3: Connect the node features of the forward propagation and the node features of the backward propagation to obtain the overall node features x , expressed as:
[0121] (14)
[0122] In the formula, represents the connection function, is the weight matrix, represents the node features propagated forward, Represents the node features for backward propagation.
[0123] Step 5: Apply linear transformation to the final user text feature vector and then fuse the overall node features to obtain the malicious social robot detection results.
[0124] Apply a linear transformation to the final user text feature vector, expressed as:
[0125] (15)
[0126] In the formula, represents the final user text feature vector after linear transformation, represents the final user text feature vector, is the weight matrix, is a variable parameter, Represents the activation function operation.
[0127] Finally, the malicious social robot detection result is obtained, which is expressed as:
[0128] (16)
[0129] In the formula, y Represents the malicious social robot detection result, is the weight matrix, represents the connection function operation, represents the final user text feature vector after linear transformation, is a variable parameter, x Represents the overall node characteristics.
[0130] Example 1
[0131] This embodiment provides a malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution, which specifically includes the following steps:
[0132] Step 1: Extract the social relationship network matrix formed in the interaction process through the content posted by users, and extract the original text content posted by users;
[0133] Step 2: Encode the original text content through the LaBSE model to obtain the final user text feature vector;
[0134] Step 3: Build a bidirectional feature enhanced heterogeneous graph convolutional network model and train it;
[0135] Step 4: Input the social relationship network matrix into the trained bidirectional feature enhanced heterogeneous graph convolutional network model to obtain the overall node features;
[0136] Step 5: Apply linear transformation to the final user text feature vector and then fuse the overall node features to obtain the malicious social robot detection results.
[0137] Example 2
[0138] This embodiment provides a malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution, which specifically includes the following steps:
[0139] Step 1: Extract the social relationship network matrix formed in the interaction process through the content posted by users, and extract the original text content posted by users;
[0140] Step 2: Encode the original text content through the LaBSE model to obtain the final user text feature vector;
[0141] Step 2.1: Extract each user’s original text content text sequence , represents a text sequence of a user, Indicates the first i sentences, of which , n Indicates the total number of sentences contained in the original text content;
[0142] Step 2.2: Use the LaBSE model to classify sentences in the text content Perform embedding calculation to get the sentence The corresponding text feature vector , expressed as:
[0143] (1)
[0144] In the formula, and are the weight matrix and bias vector in the LaBSE model;
[0145] Step 2.3: LaBSE model for sentence The corresponding text feature vector Introducing a language embedding weight , which means the sentence The language it belongs to, expressed as:
[0146] (2);
[0147] (3)
[0148] In the formula, is a hyperparameter used to control the similarity calculation, Expressing sentences With sentence The corresponding text feature vector The similarity between Expressing sentences and language The text feature vector The similarity between N Indicates the type of language;
[0149] Step 2.4: Translate the sentences The corresponding text feature vector Integration to obtain the user's text feature vector , the final user text feature vector is calculated through the fully connected layer and the activation function PReLU ,in represents the feature embedding dimension matrix, Dim The row representing the feature embedding dimension matrix is 256; the final user text feature vector calculation formula is as follows:
[0150] (4)
[0151] In the formula, Represents the activation function PReLU.
[0152] Step 3: Build a bidirectional feature enhanced heterogeneous graph convolutional network model and train it;
[0153] Step 3.1: Construct the feature-enhanced heterogeneous network layer EHGT;
[0154] After linear transformation of the node features obtained in the network layer of the heterogeneous graph convolutional neural network HGT, the GELU activation function is used for activation, and an additional linear transformation is performed again to obtain the enhanced feature nodes. The enhanced feature nodes and the original feature nodes are weighted to obtain the EHGT output of the target node. The calculation process is expressed as:
[0155] (5)
[0156] In the formula, Represents the parameters for weight transformation of enhanced feature nodes and original feature nodes, which are scaled to the range [0,1] by Sigmoid; W lin is the weight of the linear transformation, W enhance is the weight of the additional linear transformation, represents the GELU activation function, Indicates the target node In the The EHGT output of the layer, Indicates the target node In the HGT output of the layer;
[0157] Step 3.2: Construct a bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT;
[0158] The bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT contains two layers of feature enhanced heterogeneous network layers EHGT, namely the forward propagation EHGT network layer and the backward propagation EHGT network layer, which learn the social network structure forward and backward respectively;
[0159] The forward propagation EHGT network layer calculation process is as follows:
[0160] (6);
[0161] (7)
[0162] In the formula, Indicates the target node In the HGT forward output of the layer; b Represents the source node, e represents the forward propagation relationship between nodes, Represents aggregation, Represents a collection of nodes, represents the attention calculation of the convolutional layer of the HGT heterogeneous network, Represents the information transfer calculation of the convolutional layer of the HGT heterogeneous network; and They represent the target nodes in the forward propagation process. In the Layer and HGT output of the layer; Represents the target node in the forward propagation process No. EHGT output of the layer;
[0163] The calculation process of the EHGT network layer for backward propagation is as follows:
[0164] (8);
[0165] (9)
[0166] In the formula, e backward represents the back propagation relationship between nodes, and They represent the target nodes in the backward propagation process. In the Layer and HGT output of the layer; Represents the target node in the backward propagation process No. EHGT output of the layer;
[0167] Step 3.3: Train the constructed bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT, and introduce the gradient penalty term into the cross entropy loss function during the training process In, it is expressed as:
[0168] (10)
[0169] In the formula, is the loss function that introduces the gradient penalty term, It is m The true label of each user, The model is m The prediction results for each user, represents the trainable model parameters, is the L2 norm, is the weight of the gradient penalty term, M is the number of users in the training set;
[0170] Cross Entropy Loss Function and Trainable Model Parameters gradient The calculation is expressed as:
[0171] (11)
[0172] In the formula, L is the iterative cross entropy loss function during training, It means k Parameters for round model training.
[0173] Step 4: Input the social relationship network matrix into the trained bidirectional feature enhanced heterogeneous graph convolutional network model to obtain the overall node features;
[0174] Step 5: Apply linear transformation to the final user text feature vector and then fuse the overall node features to obtain the malicious social robot detection results.
[0175] Example 3
[0176] This embodiment provides a malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution, which specifically includes the following steps:
[0177] Step 1: Extract the social relationship network matrix formed in the interaction process through the content posted by users, and extract the original text content posted by users;
[0178] Step 2: Encode the original text content through the LaBSE model to obtain the final user text feature vector;
[0179] Step 2.1: Extract each user’s original text content text sequence , represents a text sequence of a user, Indicates the first i sentences, among which , n Indicates the total number of sentences contained in the original text content;
[0180] Step 2.2: Use the LaBSE model to classify sentences in the text content Perform embedding calculation to get the sentence The corresponding text feature vector , expressed as:
[0181] (1)
[0182] In the formula, and are the weight matrix and bias vector in the LaBSE model;
[0183] Step 2.3: LaBSE model for sentence The corresponding text feature vector Introducing a language embedding weight , which means the sentence The language it belongs to, expressed as:
[0184] (2);
[0185] (3)
[0186] In the formula, is a hyperparameter used to control the similarity calculation, Expressing sentences With sentence The corresponding text feature vector The similarity between Expressing sentences and language The text feature vector The similarity between N Indicates the type of language;
[0187] Step 2.4: Translate the sentences The corresponding text feature vector Integration to obtain the user's text feature vector , the final user text feature vector is calculated through the fully connected layer and the activation function PReLU ,in represents the feature embedding dimension matrix, Dim The row representing the feature embedding dimension matrix is 256; the final user text feature vector calculation formula is as follows:
[0188] (4)
[0189] In the formula, Represents the activation function PReLU.
[0190] Step 3: Build a bidirectional feature enhanced heterogeneous graph convolutional network model and train it;
[0191] Step 3.1: Construct the feature-enhanced heterogeneous network layer EHGT;
[0192] After linear transformation of the node features obtained in the network layer of the heterogeneous graph convolutional neural network HGT, the GELU activation function is used for activation, and an additional linear transformation is performed again to obtain the enhanced feature nodes. The enhanced feature nodes and the original feature nodes are weighted to obtain the EHGT output of the target node. The calculation process is expressed as:
[0193] (5)
[0194] In the formula, Represents the parameters for weight transformation of enhanced feature nodes and original feature nodes, which are scaled to the range [0,1] by Sigmoid; W lin is the weight of the linear transformation, W enhance is the weight of the additional linear transformation, represents the GELU activation function, Indicates the target node In the The EHGT output of the layer, Indicates the target node In the HGT output of the layer;
[0195] Step 3.2: Construct a bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT;
[0196] The bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT contains two layers of feature enhanced heterogeneous network layers EHGT, namely the forward propagation EHGT network layer and the backward propagation EHGT network layer, which learn the social network structure forward and backward respectively;
[0197] The forward propagation EHGT network layer calculation process is as follows:
[0198] (6);
[0199] (7)
[0200] In the formula, Indicates the target node In the HGT forward output of the layer; b Represents the source node, e represents the forward propagation relationship between nodes, Represents aggregation, Represents a collection of nodes, represents the attention calculation of the convolutional layer of the HGT heterogeneous network, Represents the information transfer calculation of the convolutional layer of the HGT heterogeneous network; and They represent the target nodes in the forward propagation process. In the Layer and HGT output of the layer; Represents the target node in the forward propagation process No. EHGT output of the layer;
[0201] The calculation process of the EHGT network layer for backward propagation is as follows:
[0202] (8);
[0203] (9)
[0204] In the formula, e backward represents the back propagation relationship between nodes, and They represent the target nodes in the backward propagation process. In the Layer and HGT output of the layer; Represents the target node in the backward propagation process No. EHGT output of the layer;
[0205] Step 3.3: Train the constructed bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT, and introduce the gradient penalty term into the cross entropy loss function during the training process In, it is expressed as:
[0206] (10)
[0207] In the formula, is the loss function that introduces the gradient penalty term, It is m The true label of each user, The model is m The prediction results for each user, represents the trainable model parameters, is the L2 norm, is the weight of the gradient penalty term, M is the number of users in the training set;
[0208] Cross Entropy Loss Function and Trainable Model Parameters gradient The calculation is expressed as:
[0209] (11)
[0210] In the formula, L is the iterative cross entropy loss function during training, It means k Parameters for round model training.
[0211] Step 4: Input the social relationship network matrix into the trained bidirectional feature enhanced heterogeneous graph convolutional network model to obtain the overall node features;
[0212] Step 4.1: Embed the social relationship network matrix into the forward propagation EHGT network layer, and obtain the forward propagation node features through the forward propagation process , expressed as:
[0213] (12)
[0214] In the formula, , is the weight matrix obtained by the system through parameter training, Represents the GELU activation function operation, Represents the target node in the forward propagation process No. EHGT output of the layer;
[0215] Step 4.2: The social relationship network matrix between users is passed through the EHGT network layer to obtain the node features of the backpropagation. , expressed as:
[0216] (13)
[0217] In the formula, , is the weight matrix obtained by the system through parameter training, Represents the GELU activation function operation, Represents the target node in the backward propagation process No. EHGT output of the layer;
[0218] Step 4.3: Connect the node features of the forward propagation and the node features of the backward propagation to obtain the overall node features x , expressed as:
[0219] (14)
[0220] In the formula, represents the connection function, is the weight matrix, represents the node features propagated forward, Represents the node features for backward propagation.
[0221] Step 5: Apply linear transformation to the final user text feature vector and then fuse the overall node features to obtain the malicious social robot detection results.
[0222] Apply a linear transformation to the final user text feature vector, expressed as:
[0223] (15)
[0224] In the formula, represents the final user text feature vector after linear transformation, represents the final user text feature vector, is the weight matrix, is a variable parameter, Represents the activation function operation.
[0225] Malicious social robot detection results, expressed as:
[0226] (16)
[0227] In the formula, y Represents the malicious social robot detection result, is the weight matrix, represents the connection function operation, represents the final user text feature vector after linear transformation, is a variable parameter, x Represents the overall node characteristics.
[0228] Simulation experiment:
[0229] The public datasets TwiBot-22 and MGTAB are selected to evaluate the proposed method. TwiBot-22 is the most widely used dataset for Twitter robot detection, with 1,000,000 expert-annotated users and 14 types of social relationships. MGTAB has more than 1.55 million users and 130 million tweets, and contains 10,199 expert-annotated users and 7 types of relationships, with high-quality annotations and diverse relationships.
[0230] Performance evaluation indicators: To evaluate the performance of the proposed method, four performance indicators, namely precision, recall, F1-score and accuracy, are used. TP (True Positive) represents the number of social robots that are correctly detected, FN (False Negative) represents the number of social robots that are incorrectly detected, FP (False Positive) is the number of human users that are incorrectly detected, and TN (True Negative) is the number of human users that are correctly detected.
[0231] Accuracy: It is the percentage of correct results in the total samples.
[0232] (17)
[0233] Precision: is the percentage of predicted positives that are correctly classified.
[0234] (18)
[0235] Recall: is the percentage of actual positives that are correctly classified:
[0236] (19)
[0237] F1-score: combines recall and precision to produce a single metric that is between these two metrics:
[0238] (20)
[0239] In this experiment, a detailed experimental evaluation of different types of graph convolutional neural networks for malicious social bot detection was conducted and their performance was compared with the BI-EHGT model. Figure 3The experimental results show that the BI-EHGT model performs well in all evaluation indicators. On the MGTAB dataset, each graph convolution model shows different performance. The GCN model achieved an accuracy of 83.24%, the GAT model was slightly higher than GCN, at 84.80%, and GraphSage and RGCN were 80.59% and 82.25%, respectively. The BI-EHGT model proposed in this invention performs well on the MGTAB dataset, with an accuracy of up to 91.52%. This result shows that in a single graph convolution model, GAT performs slightly better than GCN and GraphSage, while RGCN performs slightly worse. On the Twibot-22 dataset, GCN, GAT and GraphSage are relatively close in accuracy, at 77.39%, 78.48% and 78.54%, respectively, while RGCN performs relatively poorly on this dataset, with an accuracy of 73.53%. In contrast, the BI-EHGT model still shows a significant performance advantage on the Twibot-22 dataset.
[0240] From the experimental results of the two data sets, different graph convolution models show certain differences in the malicious social robot detection task. The performance indicators of BI-EHGT proposed in the present invention are better than those of other single graph convolution models. The model of the present invention fully considers the multi-faceted behaviors of social robots and takes the processed interactive relationship network matrix as input to more comprehensively capture the behavioral characteristics of social robots. Secondly, BI-EHGT constructs a feature-enhanced bidirectional heterogeneous network, and improves the feature expression ability and the robustness of the model by introducing a feature enhancement module in the HGT heterogeneous graph convolution network layer. The bidirectional heterogeneous graph convolution network model BI-EHGT comprehensively captures the relationship between nodes and neighboring nodes, thereby providing richer information and more accurate node representation. Finally, BI-EHGT uses the extracted text features as an auxiliary module to fuse the input features of the graph convolution, making full use of multi-source information, further strengthening the feature representation, and improving the classification performance and the robustness of the model. The BI-EHGT model has achieved significant advantages in social robot behavior detection and demonstrated its performance in complex tasks.
Claims
1. A malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution, characterized in that: The specific steps include: Step 1: Extract the social relationship network matrix formed in the interaction process through the content posted by users, and extract the original text content posted by users; Step 2: Encode the original text content through the LaBSE model to obtain the final user text feature vector; Step 2.1: Extract each user’s original text content text sequence , represents a text sequence of a user, Indicates the first i sentences, of which , n Indicates the total number of sentences contained in the original text content; Step 2.2: Use the LaBSE model to classify sentences in the text content Perform embedding calculation to get the sentence The corresponding text feature vector , expressed as: (1) In the formula, and are the weight matrix and bias vector in the LaBSE model; Step 2.3: LaBSE model for sentence The corresponding text feature vector Introducing a language embedding weight , which means the sentence The language it belongs to, expressed as: (2); (3) In the formula, is a hyperparameter used to control the similarity calculation, Expressing sentences With sentence The corresponding text feature vector The similarity between Expressing sentences and language The text feature vector The similarity between N Indicates the type of language; Step 2.4: Translate the sentences The corresponding text feature vector Integration to obtain the user's text feature vector , the final user text feature vector is calculated through the fully connected layer and the activation function PReLU ,in represents the feature embedding dimension matrix, Dim The row representing the feature embedding dimension matrix is 256; the final user text feature vector calculation formula is as follows: (4) In the formula, represents the final user text feature vector, represents the activation function PReLU; Step 3: Build a bidirectional feature enhanced heterogeneous graph convolutional network model and train it; Step 3.1: Construct the feature-enhanced heterogeneous network layer EHGT; After linear transformation of the node features obtained in the network layer of the heterogeneous graph convolutional neural network HGT, the GELU activation function is used for activation, and an additional linear transformation is performed again to obtain the enhanced feature nodes. The enhanced feature nodes and the original feature nodes are weighted to obtain the EHGT output of the target node. The calculation process is expressed as: (5) In the formula, Represents the parameters for weight transformation of enhanced feature nodes and original feature nodes, which are scaled to the range [0,1] by Sigmoid; W lin is the weight of the linear transformation, W enhance is the weight of the additional linear transformation, Represents the GELU activation function operation, Indicates the target node In the The EHGT output of the layer, Indicates the target node In the HGT output of the layer; Step 3.2: Construct a bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT; The bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT includes two layers of feature enhanced heterogeneous network layers EHGT, namely, a forward propagation EHGT network layer and a backward propagation EHGT network layer, which respectively learn the social network structure forward and backward; The forward propagation EHGT network layer calculation process is as follows: (6); (7) In the formula, Indicates the target node In the HGT forward output of the layer; b Represents the source node, e represents the forward propagation relationship between nodes, Represents aggregation, Represents a collection of nodes, represents the attention calculation of the convolutional layer of the HGT heterogeneous network, Represents the information transfer calculation of the convolutional layer of the HGT heterogeneous network; and They represent the target nodes in the forward propagation process. In the Layer and HGT output of the layer; Represents the target node in the forward propagation process No. EHGT output of the layer; The calculation process of the EHGT network layer for backward propagation is as follows: (8); (9) In the formula, e backward represents the back-propagation relationship between nodes, and They represent the target nodes in the backward propagation process. In the Layer and HGT output of the layer; Represents the target node in the backward propagation process No. EHGT output of the layer; Step 3.3: Train the constructed bidirectional feature enhanced heterogeneous graph convolutional network model BI-EHGT, and introduce the gradient penalty term into the cross entropy loss function during the training process In, it is expressed as: (10) In the formula, is the loss function that introduces the gradient penalty term, It is m The real label of each user, The model is m The prediction results for each user, represents the trainable model parameters, is the L2 norm, is the weight of the gradient penalty term, M is the number of users in the training set; Cross Entropy Loss Function and Trainable Model Parameters gradient The calculation is expressed as: (11) In the formula, L is the iterative cross entropy loss function during training, It means k Parameters for round model training; Step 4: Input the social relationship network matrix into the trained bidirectional feature enhanced heterogeneous graph convolutional network model to obtain the overall node features; Step 4.1: Embed the social relationship network matrix into the forward propagation EHGT network layer, and obtain the forward propagation node features through the forward propagation process , expressed as: (12) In the formula, , is the weight matrix obtained by the system through parameter training, Represents the GELU activation function operation, Represents the target node in the forward propagation process No. EHGT output of the layer; Step 4.2: The social relationship network matrix between users is passed through the EHGT network layer to obtain the node features of the backpropagation. , expressed as: (13) In the formula, , is the weight matrix obtained by the system through parameter training, Represents the GELU activation function operation, Represents the target node in the backward propagation process No. EHGT output of the layer; Step 4.3: Connect the node features of the forward propagation and the node features of the backward propagation to obtain the overall node features x , expressed as: (14) In the formula, represents the connection function operation, is the weight matrix, represents the node features propagated forward, represents the node features for backward propagation; Step 5: Apply linear transformation to the final user text feature vector and then fuse the overall node features to obtain the malicious social robot detection results.
2. According to claim 1, the malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution is characterized in that: In step 5, a linear transformation is applied to the final user text feature vector, expressed as: (15) In the formula, represents the final user text feature vector after linear transformation, represents the final user text feature vector, is the weight matrix, is a variable parameter, Represents the activation function operation.
3. According to claim 2, the malicious social robot detection method based on bidirectional feature enhanced heterogeneous graph convolution is characterized in that: The malicious social robot detection result in step 5 is expressed as: (16) In the formula, y Represents the malicious social robot detection result, is the detection result weight matrix, represents the connection function operation, represents the final user text feature vector after linear transformation, is a variable parameter, x Represents the overall node characteristics.
