Graph-enhanced social robot detection method and device based on reinforcement learning
Through the feature fusion of multi-layer perceptron and pre-trained language model, neighborhood-aware interpolation and edge filtering strategy, the problems of category imbalance and topological noise in social robot detection are solved, and high-accuracy and stable social robot recognition is achieved.
Patent Information
- Application Number
- CN202510893369.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-10
AI Technical Summary
Existing social robot detection methods have low detection accuracy and poor robustness when faced with category imbalance and topological noise interference, making it difficult to effectively identify well-disguised robot nodes.
Social network user information is extracted through multi-layer perceptrons and pre-trained language models, and feature fusion is performed in combination with a multi-head self-attention mechanism. Oversampling is performed using a neighborhood-aware linear interpolation method, and the edge retention threshold is dynamically adjusted to remove unreliable connections and optimize the graph structure. Finally, the information is input into a graph neural network for recognition.
It significantly improves the accuracy and stability of social robot detection, and can accurately identify highly hidden robot nodes in the presence of category imbalance and topological noise. It is suitable for large-scale social network environments.
Smart Images

Figure CN120763532A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of social robot detection, and specifically relates to a graph-enhanced social robot detection method and device based on reinforcement learning. Background Art
[0002] As social media becomes the primary platform for public information exchange, the infiltration of social bots has become a significant concern in both academia and practice. Social bots are software agents that mimic human users, enabling them to engage in large-scale interactions across various online platforms by emulating human behavior. Empirical research has linked them to a variety of harmful activities, including the spread of false information, election interference, manipulation of public opinion, and the dissemination of extreme ideologies. Therefore, developing effective bot detection technologies is crucial for mitigating these threats and maintaining the trustworthiness of online information ecosystems.
[0003] Current social bot detection methods are mainly divided into two categories: feature-based methods and graph-based methods. Feature-based methods usually analyze user metadata or text content. Metadata includes numerical attributes (such as the number of followers) and categorical attributes (such as whether it is verified); the classifier distinguishes between bots and real users by comparing the differences in these attributes. Text-based models use word vector encoders or pre-trained language models to process tweets and personal profiles, extracting potential semantic clues from them to identify automated behavior. Although these shallow features have a certain amount of information, it is often difficult to identify well-disguised bots. Adversaries can copy a large amount of real user information and inject only a small amount of malicious content, thereby effectively narrowing the observable gap between bots and real accounts.
[0004] To address these limitations, recent research has shifted toward graph-based approaches, leveraging recent advances in graph neural networks (GNNs). These models are based on the empirical observation that real users typically form tight communities, while bots connect in a more random manner, exhibiting unique topological characteristics. By explicitly modeling the structure of social networks, graph-based detectors often outperform feature-based methods. However, these approaches still face two key challenges: First, class imbalance: bot nodes are far fewer than human nodes in social graphs. This skew biases the model toward the majority class, leading to systematic misclassification of bots. Therefore, mitigating severe class imbalance is crucial for achieving reliable detection. Second, noisy or spurious edges: Social graphs often contain unreliable interactions, such as edges connecting human accounts to bots. During the information aggregation process, these edges introduce bot characteristics into supposedly harmless neighborhoods; deeper GNN layers further propagate and amplify this noise, ultimately compromising detection performance. Summary of the Invention
[0005] In order to overcome the shortcomings of the existing technology, the present invention provides a graph-enhanced social robot detection method and device based on reinforcement learning, including the following steps: Step 1: Using a multi-layer perceptron and a pre-trained language model to extract metadata information and text information of users in a social network, and performing feature fusion on the above information through a multi-head self-attention mechanism to generate a user representation; Step 2: Using a linear interpolation method based on neighborhood awareness to oversample minority class nodes in the latent feature space to construct a balanced training sample set; Step 3: Based on feature similarity and reinforcement learning strategy, dynamically adjust the edge retention threshold, perform edge filtering operations to remove unreliable connections and optimize the graph structure; Step 4: Input the enhanced node features and the purified graph structure into a graph neural network classifier to achieve accurate identification of social robot nodes. The method provided by the present invention can effectively alleviate the misjudgment problem caused by category imbalance, while reducing the impact of topological noise on model performance, significantly improving detection accuracy and stability. In addition, the method can be seamlessly integrated into the existing graph neural network framework, has good versatility and scalability, and is suitable for automated robot recognition tasks in large-scale social network environments.
[0006] The technical solutions adopted by the present invention to solve the technical problems are as follows:
[0007] Step 1: Use a multi-layer perceptron and a pre-trained language model to extract metadata and text information of users in the social network, and then fuse the metadata and text information through a multi-head self-attention mechanism to generate user representations;
[0008] Step 2: Use the neighborhood-aware linear interpolation method to oversample the minority class nodes in the latent feature space to construct a balanced training sample set;
[0009] Step 3: Dynamically adjust the edge retention threshold based on feature similarity and reinforcement learning strategy, perform edge filtering to remove unreliable connections and optimize the graph structure;
[0010] Step 4: Input the results of steps 2 and 3 into the graph neural network classifier to identify the social robot nodes.
[0011] Furthermore, the step 1 is specifically as follows:
[0012] For a social network graph G(V,E), where V represents the set of user nodes and E represents the set of social connections; each node v i Contains four types of attributes: numerical attributes Boolean properties User Profile User tweets The multi-layer perceptron MLP and pre-trained language model are used to encode and then the multi-head self-attention mechanism is used to generate a unified user representation u.i .
[0013] Furthermore, the pre-trained language model is Roberta.
[0014] Furthermore, the user representation u i The extraction process is as follows:
[0015] Step 1-1: For each node v i , using multi-layer perceptron MLP to extract metadata information of users in social networks and obtain numerical features and Boolean features
[0016] Step 1-2: For each node v i , using the pre-trained language model Roberta to extract the text information of users in the social network to obtain user description features And synthesize user tweet features through average pooling
[0017] Steps 1-3: Concatenate user numerical features Boolean features Describing features and tweet features And the weighted fusion of different modal features is performed through the multi-head self-attention mechanism;
[0018] Step 1-4: Output the fused user representation u i .
[0019] Furthermore, the step 2 is specifically as follows:
[0020] In the feature space, for the minority class robot node set V1, its k nearest neighbor nodes of the same type are found, similarity is measured according to the Euclidean distance, and new samples are synthesized using the linear interpolation method to achieve node balanced sampling.
[0021] Furthermore, the linear interpolation method is specifically as follows:
[0022] Step 2-1: Divide the user set V into the minority class node set V1 and the majority class node set V2;
[0023] Step 2-2: For each minority class node v i ∈V1, based on the Euclidean distance L(u i ,u j )=||u i -u j ||2, select the k nearest neighbors from the same node to form the neighbor set Γ(v i );u i 、u jRepresents node v i and node v j The corresponding initial eigenvector;
[0024] Step 2-3: Randomly select a node v from the neighbor set x ∈Γ(v i ), perform linear interpolation according to the proportion δ to synthesize the new node features: u k =(1-δ)u i +δu x ,δ~U(0,1);u x Represents node v x The corresponding initial eigenvector;
[0025] Step 2-4: Combine the nodes v k Mark it as the minority class and add it to the training set. Repeat the above process until the number of categories is balanced to obtain the enhanced user representation.
[0026] Furthermore, the step 3 is specifically as follows:
[0027] First, a single-layer MLP is used to extract node representations, and the feature similarity between neighboring nodes is calculated and converted into edge retention probability p ij ; A learnable edge retention threshold τ is introduced to determine whether an edge is retained; the edge retention decision is supervised by the edge-level binary cross-entropy loss; every T training cycles, the state features are input into the lightweight reinforcement learning policy network to update τ to achieve dynamic adjustment of the edge filtering strategy.
[0028] The state features include feature mean, feature variance, accuracy change, and loss change.
[0029] Furthermore, the edge filtering strategy is as follows:
[0030] Step 3-1: For each pair of adjacent nodes (v i ,v j )∈E, perform label prediction on each previous layer feature through a single-layer MLP, and calculate the relationship between the two Distance as a similarity measure D i,j =||σ(MLP(h i ))-σ(MLP(h j ))||1, and calculate the edge retention probability: p i,j =1-D i,j ;h i 、h j Represents node v i and node v j The eigenvector after the initial vector of is propagated through the linear layer;
[0031] Step 3-2: Introduce a learnable edge retention threshold τ to determine whether the edge is retained: If p i,j ≥τ, then keep the edge, otherwise remove it;
[0032] Step 3-3: Use the same / different edge labels to construct the edge-level binary cross entropy loss function to guide the model to retain the same edges and delete the different edges;
[0033] Step 3-4: Every T training cycles, collect the current feature mean, variance, accuracy and loss changes to form a state vector s, and pass it through the policy network π θ (s) Generate adjustment action a and update the τ value: τ←τ+(2a-1)λ.
[0034] Furthermore, the step 4 is specifically as follows:
[0035] Step 4-1: Take the enhanced user representation and the filtered edge set as input and input them into the graph neural network GNN;
[0036] Step 4-2: Aggregate neighbor information using a message passing mechanism and update node feature representation: Represents node v i The neighbor set of ;AREATE(.) represents the information aggregation operation;
[0037] Step 4-3: The output layer uses Softmax to predict each node: W and b are both learnable model weight parameters;
[0038] Step 4-4: Comprehensively consider the original node classification loss, enhanced node classification loss and edge filtering supervision loss, construct a joint loss function, and optimize the overall model performance.
[0039] A graph-enhanced social robot detection device based on reinforcement learning, comprising:
[0040] A representation unit is used to collect multi-source information about users on social networks; this multi-source information includes users' numerical attributes, Boolean attributes, textual profiles, and historical tweets. The representation unit embeds this multi-modal information using a multi-layer perceptron and a pre-trained language model, and uses a multi-head self-attention mechanism for fusion encoding to generate a unified user feature representation vector, providing basic feature support for subsequent modules.
[0041] The enhancement unit is used to alleviate the problem of class imbalance. Based on the neighborhood perception strategy, the enhancement unit performs linear interpolation sampling on the minority class robot nodes in the feature space to generate synthetic sample nodes, balance the class distribution of the training set, and ensure that the synthetic nodes remain semantically consistent with the original nodes, thereby enhancing the model's expressive ability for minority classes.
[0042] The filtering unit is used to optimize the social network topology. It first calculates the feature similarity between node pairs and generates an edge retention probability based on this similarity. It then uses a learnable edge filtering threshold τ to determine whether to retain an edge. Furthermore, the filtering unit dynamically adjusts the threshold τ through a reinforcement learning module every fixed training cycle to adapt to structural changes during model training, thereby effectively removing noise edges and improving the quality of the graph structure.
[0043] The classification unit is used to input the enhanced node features and filtered graph structure into the graph neural network model, update the node representation through a multi-layer message passing mechanism, and use the Softmax function for binary classification in the output layer to finally complete the automatic identification of social robot nodes.
[0044] The beneficial effects of the present invention are as follows:
[0045] The method of the present invention, through the collaborative design of multimodal user information fusion, minority class feature enhancement, and reinforcement learning-based edge filtering mechanisms, can significantly alleviate the interference of category imbalance and topological structure noise on the accuracy of social robot detection while maintaining the semantic integrity of the graph structure. The method provided by the present invention can improve the recognition ability of highly hidden robot nodes under the same resource conditions, while avoiding misjudgment interference of normal users. In addition, the method of the present invention can be flexibly integrated into mainstream graph neural network systems and is suitable for real-time security management and automated detection tasks under large-scale social graph data. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a flow chart of the method of the present invention;
[0047] Figure 2 This is a diagram showing the information interference caused by unreliable edges in a social graph and a comparison of their performance impact.
[0048] Figure 3 This is a performance comparison chart of the present invention and different edge deletion strategies.
[0049] Figure 4 This is a robustness analysis diagram of the present invention under the condition of limited labeled data.
[0050] Figure 5 It is a sensitivity analysis diagram of the present invention under different loss function weight configurations.
[0051] Figure 6 This is a comparative case analysis diagram of a subgraph containing human nodes and robot nodes before and after being processed by the method of the present invention.
[0052] Figure 7 This is a sensitivity analysis chart of the number of graph neural network layers. DETAILED DESCRIPTION
[0053] The present invention will be further described below with reference to the accompanying drawings and examples.
[0054] The present invention provides a graph-enhanced social robot detection method and device based on reinforcement learning, including the following steps: Step 1: Using a multi-layer perceptron and a pre-trained language model to extract metadata information and text information of users in a social network, and performing feature fusion on the above information through a multi-head self-attention mechanism to generate a user representation; Step 2: Using a linear interpolation method based on neighborhood awareness to oversample minority class nodes in the latent feature space to construct a balanced training sample set; Step 3: Based on feature similarity and reinforcement learning strategy, dynamically adjust the edge retention threshold, perform edge filtering operations to remove unreliable connections and optimize the graph structure; Step 4: Input the enhanced node features and the purified graph structure into a graph neural network classifier to achieve accurate identification of social robot nodes. The method provided by the present invention can effectively alleviate the misjudgment problem caused by category imbalance, while reducing the impact of topological noise on model performance, significantly improving detection accuracy and stability. In addition, the method can be seamlessly integrated into the existing graph neural network framework, has good versatility and scalability, and is suitable for automated robot recognition tasks in large-scale social network environments.
[0055] The technical solutions adopted by the present invention to solve the technical problems are as follows:
[0056] Step 1: Use a multi-layer perceptron and a pre-trained language model to extract metadata and text information of users in the social network, and then fuse the above information through a multi-head self-attention mechanism to generate user representations;
[0057] Step 2: Use the neighborhood-aware linear interpolation method to oversample the minority class nodes in the latent feature space to construct a balanced training sample set;
[0058] Step 3: Dynamically adjust the edge retention threshold based on feature similarity and reinforcement learning strategy, perform edge filtering to remove unreliable connections and optimize the graph structure;
[0059] Step 4: Input the enhanced node features and the purified graph structure into the graph neural network classifier to achieve accurate identification of social robot nodes, effectively alleviate the misjudgment problem caused by category imbalance, and at the same time reduce the impact of topological noise on model performance, significantly improving detection accuracy and stability.
[0060] Step 1 is as follows:
[0061] For a social network graph G(V,E), where V represents the set of user nodes and E represents the set of social connections. Each node v i Contains four types of attributes: numerical attributes Boolean properties User Profile User tweets The unified user representation u is generated by encoding through the multi-layer perceptron MLP and the pre-trained language model Roberta, and then fused using the multi-head self-attention mechanism. i .
[0062] User said u i The extraction process is as follows:
[0063] Step 1-1: For each node v i , using multi-layer perceptron MLP to extract metadata information of users in social networks and obtain numerical features and Boolean features
[0064] Step 1-2: For each node v i , using the pre-trained language model Roberta to extract the text information of users in the social network to obtain user description features And synthesize user tweet features through average pooling
[0065] Steps 1-3: Concatenate user numerical features Boolean features Describing features and tweet features And the weighted fusion of different modal features is performed through the multi-head self-attention mechanism;
[0066] Step 1-4: Output the fused user representation u i .
[0067] Step 2 is as follows:
[0068] In the feature space, for the minority class robot node set V1, its k nearest neighbor nodes of the same type are found, similarity is measured according to the Euclidean distance, and new samples are synthesized using the linear interpolation method to achieve node balanced sampling.
[0069] The linear interpolation method is as follows:
[0070] Step 2-1: Divide the user set V into the minority class node set V1 and the majority class node set V2;
[0071] Step 2-2: For each minority class node vi ∈V1, based on the Euclidean distance L(u i ,u j )=||u i -u j ||2, select the k nearest neighbors from the same node to form the neighbor set Γ(v i );
[0072] Step 2-3: Randomly select a node v from the neighbor set x ∈Γ(v i ), perform linear interpolation according to the proportion δ to synthesize the new node features: u k =(1-δ)u i +δu x ,δ~U(0,1).
[0073] Step 2-4: Combine the nodes v k Mark it as the minority class and add it to the training set. Repeat the above process until the number of categories is balanced to obtain the enhanced user representation.
[0074] Step 3 is as follows:
[0075] First, a single-layer MLP is used to extract node representations, and the feature similarity between neighboring nodes is calculated and converted into edge retention probability p ij A learnable edge retention threshold τ is introduced to determine whether an edge should be retained. The edge retention decision is supervised by the edge-level binary cross-entropy loss. Every T training cycles, the state features (including feature mean, feature variance, accuracy change, and loss change) are input into the lightweight reinforcement learning policy network to update τ, realizing dynamic adjustment of the edge filtering strategy.
[0076] The edge filtering strategy is as follows:
[0077] Step 3-1: For each pair of adjacent nodes (v i ,v j )∈E, perform label prediction on each previous layer feature through a single-layer MLP, and calculate the relationship between the two Distance as a similarity measure D i,j =||σ(MLP(h i ))-σ(MLP(h j ))||1, and calculate the edge retention probability: p i,j =1-D i,j .
[0078] Step 3-2: Introduce a learnable edge retention threshold τ to determine whether the edge is retained: If p i,j ≥τ, then keep the edge, otherwise remove it;
[0079] Step 3-3: Use edge labels (same / different) to construct an edge-level binary cross entropy loss function to guide the model to retain similar edges and delete different edges;
[0080] Step 3-4: Every T training cycles, collect the current feature mean, variance, accuracy and loss changes to form a state vector s, and pass it through the policy network π θ (s) Generate adjustment action a and update the τ value: τ←τ+(2a-1)λ.
[0081] Step 4 is as follows:
[0082] Step 4-1: Take the enhanced user representation and the filtered edge set as input and input them into the graph neural network GNN (such as GCN / GAT architecture);
[0083] Step 4-2: Aggregate neighbor information using a message passing mechanism and update node feature representation:
[0084] Step 4-3: The output layer uses Softmax to predict each node:
[0085] Step 4-4: Comprehensively consider the original node classification loss, enhanced node classification loss and edge filtering supervision loss, construct a joint loss function, and optimize the overall model performance.
[0086] A graph-enhanced social robot detection device based on reinforcement learning, comprising:
[0087] The representation unit is used to collect multi-source information about users on social networks, including numerical attributes, Boolean attributes, textual profiles, and historical tweets. This unit embeds this multimodal information using a multi-layer perceptron and a pre-trained language model, and employs a multi-head self-attention mechanism for fusion encoding to generate a unified user feature representation vector, providing basic feature support for subsequent modules.
[0088] The enhancement unit is used to alleviate the problem of class imbalance. Based on the neighborhood-aware strategy, this unit performs linear interpolation sampling on minority class robot nodes in the feature space to generate synthetic sample nodes, balance the class distribution of the training set, and ensure that the synthetic nodes remain semantically consistent with the original nodes, thereby enhancing the model's expressive ability for minority classes.
[0089] A filtering unit is used to optimize the social network topology; the unit first calculates the feature similarity between node pairs, and generates an edge retention probability based on the similarity, and then combines a learnable edge filtering threshold tau to determine whether the edge is retained or not; at the same time, the filtering unit dynamically adjusts the threshold tau through the reinforcement learning module every fixed training period to adapt to the structural changes in the model training process, thereby effectively eliminating noise edges and improving the quality of the graph structure;
[0090] A classification unit is used to input the enhanced node features and filtered graph structure into a graph neural network model, update the node representation through a multi-layer message passing mechanism, and perform binary classification in the output layer using a Softmax function, and finally complete the automatic identification of social robot nodes.
[0091] Embodiments:
[0092] The present application is used to solve the problem of low recognition accuracy and poor model robustness caused by class distribution imbalance and graph structure noise interference in the prior art in the social robot detection task. In order to overcome these technical bottlenecks, the present application provides a social robot detection method driven by reinforcement learning and graph enhancement, and the specific implementation scheme is as follows:
[0093] In the user feature representation construction phase, the present application embeds and encodes the multi-modal information of the user (including numerical attributes, Boolean attributes, user profiles and user tweets), and performs weighted fusion through a multi-head attention mechanism to generate a unified user representation vector, thereby improving the representation ability of the node. In the class imbalance enhancement phase, the present application uses a neighborhood-aware interpolation strategy to perform semantic consistency sampling on the minority class robot nodes in the feature space, generates a synthetic node from the same neighbor nodes, effectively expands the minority class sample space, and significantly alleviates the bias problem caused by the class distribution imbalance to the classifier. In the topology noise suppression phase, the present application introduces an edge retention mechanism based on node feature similarity calculation, dynamically adjusts the edge retention threshold combined with a reinforcement learning strategy, discriminates and eliminates unreliable connections, thereby maintaining the integrity of the graph structure while reducing the interference of misleading connections on the aggregation process of the graph neural network. Finally, in the classification phase, the present application inputs the enhanced node features and filtered graph structure into the graph neural network classifier, and realizes the classification prediction of the user nodes through a multi-layer message passing mechanism. By fusing the original node loss, the enhanced node loss and the edge filtering supervision loss to build a joint optimization objective, the accuracy and stability of the detection are further improved.
[0094] By synergizing graph structure optimization strategies with feature enhancement strategies, this method significantly improves social robot recognition while maintaining the same computational resource consumption. Alternatively, while achieving the same recognition accuracy, it effectively reduces the amount of training data and model complexity, resulting in highly efficient resource utilization and deployment feasibility. Furthermore, the method has low time complexity and is suitable for automated robot detection tasks within large-scale social network graphs. It can be widely applied in a variety of practical scenarios, including network security and disinformation management.
[0095] like Figure 1 As shown, the present invention provides a social robot detection device jointly driven by reinforcement learning and graph enhancement. It mainly includes: multimodal user representation, which is used to extract and fuse multi-source node information; feature enhancement, which is used to generate minority class synthetic nodes based on neighborhood interpolation; unreliable edge filtering, which optimizes the graph structure through similarity measurement and reinforcement learning strategy; and network node classification, which uses a graph neural network classifier to update the features and ultimately predict the classification of nodes in the social network. Through the collaborative work of these four stages, the device comprehensively solves the problems of class imbalance and structural noise interference. Specifically, it includes the following steps:
[0096] Step 1: Given a social graph G(V,E), for each node v i ∈V, collects four types of raw data including numerical attributes, Boolean attributes, user profile text and tweet sequences. Numerical attributes such as the number of followers, number of fans, and posting frequency, and Boolean attributes such as whether the user is a certified user and whether geolocation is enabled, are encoded into numerical vectors through a multi-layer perceptron (MLP). With Boolean vector User profile text is encoded into a description vector using a pre-trained language model (such as RoBERTa) At the same time, each tweet in the user's historical tweet sequence is embedded using the same language model and synthesized into a tweet representation vector through average pooling. The four types of feature representations are then concatenated to obtain a preliminary multimodal vector representation, which is further input into the multi-head self-attention mechanism module, where each modality sub-vector is mapped into three sets of vectors: query, key, and value. The importance of different modalities is dynamically weighted through attention weights, and finally fused into a unified user representation vector u i .
[0097] Step 2: First, divide the node set V into the minority class set V1 (i.e., robot nodes) and the majority class set V2 (i.e., normal user nodes) according to the category label; then for each v i ∈V1, with its unified feature representation u iBased on it, calculate the Euclidean distance L(u i ,u j )=||u i -u j ||2, select k nearest neighbor nodes with the smallest distance from V1 to form the neighbor set Γ(v i ); Then, randomly select a node v from the neighbor set x ∈Γ(v i ), and use the linear interpolation formula u according to the proportional coefficient δ~U(0,1) k =(1-δ)u i +δu x Generate a new node feature vector u k The synthesized node is labeled as a robot and added to the training dataset. This process is repeated until the number of minority class samples is comparable to that of the majority class, forming a balanced training set. This prevents the graph neural network from being biased towards the majority class during training, while ensuring that the interpolated nodes are reasonable in the semantic space and maintain the original data distribution structure.
[0098] Step 3: Considering that there are a lot of fake connections in the social graph structure, for each pair of adjacent nodes (v i ,v j )∈E, based on the current layer node representation h in its graph neural network i With h j , respectively, obtain the prediction vector through a single-layer multi-layer perceptron (MLP) and calculate its l1 distance D i,j =||σ(MLP(h i ))-σ(MLP(h j ))||1, based on which the edge retention probability is defined as p i,j =1-D i,j ; Then set the learnable edge retention threshold τ, if p i,j ≥τ, the edge is retained; otherwise, the edge is marked as invalid and removed during the propagation process; to enhance the stability and adaptability of the filtering strategy, edge labels are introduced to construct edge-level binary cross entropy loss, guiding the model to learn to retain edges between similar nodes and remove heterogeneous connections; further, after every T training cycles, the model state features (including accuracy changes, loss changes, node feature mean and variance) are collected to form a state vector s, which is input into the lightweight strategy network π θ (s), generates an adjustment action a∈{0,1}, which is used to update the edge filtering threshold τ←τ+(2a-1)λ, realizes the adaptive optimization of the filtering strategy, and effectively improves the expressiveness of the graph structure and the accuracy of information dissemination.
[0099] Step 4: First, the enhanced node feature set The edge set after edge filtering —And input the graph neural network backbone model, such as GCN, GAT or RGT structures; in the network, through the multi-layer message passing mechanism, the nodes receive aggregated information from neighbor nodes in turn, according to the formula Perform feature updates and extract structure-aware embedding representations layer by layer; the final output layer uses linear mapping plus Softmax function to calculate node classification probabilities Divide each node into a robot or a normal user; in order to jointly optimize the model performance, construct a total loss function It includes the original node classification loss, the enhanced node classification loss and the edge filtering supervision loss, so that the model can take into account both expression accuracy and structural rationality during training, thereby achieving stronger robustness and generalization ability while maintaining high precision.
[0100] Figure 2 This paper presents a diagram illustrating the information interference caused by unreliable edges in social graphs and a comparison of their performance impact. The left side of the figure illustrates the feature interference caused by unreliable connections in social networks (such as edges between real users and bots). The different colors in the figure represent real and bot nodes, respectively, and dotted lines indicate fabricated, unreliable connections. The right side of the figure compares the classification performance of mainstream GNN models (GCN, GAT, RGCN, and RGT) on the Twibot-20 dataset before and after removing all unreliable edges.
[0101] Depend on Figure 2 As can be seen in the diagram on the left, the robot nodes establish fake connections with real-person nodes through camouflage, resulting in the infiltration of highly noisy edges into the graph structure. These erroneous connections severely interfere with the neighbor aggregation process of the graph neural network, causing node features to be "contaminated" during propagation. The bar chart on the right further illustrates the change in accuracy of different models (GCN, GAT, RGCN, and RGT) before and after removing unreliable edges in the Twibot-20 dataset. The results show that once the erroneous connections are removed, the performance of all models is significantly improved, confirming that edge structure noise is a significant issue that cannot be ignored in social bot detection and demonstrating the necessity and effectiveness of edge filtering mechanisms in this task.
[0102] Figure 3 This paper presents a performance comparison of our proposed method with different edge deletion strategies, demonstrating the performance differences between the proposed method using a random edge deletion strategy and the RABot built-in edge filtering module on the Cresci-15, Twibot-20, and MGTAB datasets. The horizontal axis represents different edge deletion rates (0.2 to 0.8), while the vertical axis shows the accuracy and F1 score.
[0103] Depend on Figure 3 It can be seen that on the Cresci-15, Twibot-20 and MGTAB three data sets, the model using the random edge deletion strategy has large fluctuations in accuracy and F1 score, and the overall performance is low, and after using the edge filtering module proposed in the application, the performance is significantly improved and remains more stable. Especially in the case of increasing the edge deletion ratio, the information loss caused by the random strategy is more serious, and the application effectively avoids the misdeletion of important structure edges through the feature similarity discrimination and dynamic adjustment mechanism of reinforcement learning, thereby showing stronger robustness under different graph sparsity conditions, further proving that the edge filtering strategy is of great significance to improve the generalization ability of the model.
[0104] Figure 4 The robustness performance of the method of the application under the condition of insufficient training data is given. The figure shows the data efficiency experimental results of RABot on Twibot-20 and MGTAB two data sets. The horizontal axis is the training data proportion (10%-100%), and the vertical axis is the corresponding accuracy and F1 score.
[0105] From Figure 4 It can be seen that on the Twibot-20 and MGTAB two data sets, as the training data proportion increases from 10% to 100%, the accuracy and F1 score of the method of the application always lead the existing optimal method, and even in the case of training data only accounting for half, its performance can still stably surpass other models. This shows that it still has excellent detection ability in weakly supervised or few-shot scenarios, thanks to its feature enhancement module that builds a more balanced training distribution, and the edge filtering module that ensures the effectiveness of the structure information, thereby avoiding the performance collapse problem often seen in traditional GNNs when the training samples are insufficient.
[0106] Figure 5 The performance change heat map of the method of the application under different loss weight configurations is given. The influence of two hyperparameters in the loss function: λ s (the enhanced node loss weight) and λ e (the edge filtering loss weight) on the model accuracy and F1 is analyzed. The experiment is carried out on the Cresci-15, Twibot-20 and MGTAB data sets, and the performance heat map under the parameter grid is drawn.
[0107] From Figure 5 It can be seen that on the Cresci-15, Twibot-20 and MGTAB three data sets, the enhanced node loss weight λ s and the edge filtering loss weight λ e are searched in the grid, and it is found that: the model performance remains stable within a larger range of these two hyperparameters, and only slightly fluctuates under extreme configurations. The best performance usually occurs when λ e∈[0.5,0.7], indicating that the edge filtering module has a significant impact on the final prediction. This result also demonstrates that the proposed joint optimization objective has good stability and robustness, achieving optimal detection performance without relying on complex hyperparameter tuning, and is suitable for practical deployment scenarios.
[0108] Figure 6 We present an analysis of the effectiveness of edge filtering based on the edge retention probability p and the role of feature enhancement in classification accuracy. Figure (a) shows the subgraph after feature enhancement and edge probability score calculation, where the newly added synthetic robot nodes improve the category distribution; Figure (b) shows the original graph structure without feature enhancement, which exhibits category interference.
[0109] Depend on Figure 6 As can be seen, this figure evaluates the effectiveness of the edge filtering module in removing unreliable connections. The figure shows the classification results of the same subgraph under different strategies. The right figure shows the graph structure after edge filtering alone. It can be seen that the retention probability p-values of edges between humans and robots are generally low, and they are effectively identified and removed. However, the retention probabilities of connections between humans and robots are higher, and therefore retained. This clearly demonstrates that the designed similarity discrimination and dynamic thresholding mechanism can accurately identify and remove structural noise. However, a robot node in the right figure is misclassified as a human node due to a lack of sufficient similar neighbors. The left figure further introduces a feature enhancement module based on the right figure. By synthesizing robot nodes, the number of minority class samples is increased, providing a richer set of similar neighbors, making it easier for the model to capture class boundaries and ultimately avoiding the misclassification of this node. Comparing the classification results on the left and right figures, it can be seen that the synergistic use of edge filtering and feature enhancement modules can achieve both structural purification and class balance, significantly improving classification performance and stability.
[0110] Figure 7 The performance analysis chart of the proposed method under different graph neural network layer configurations is given. The sensitivity of the proposed method to different numbers of GNN layers on the Cresci-15, Twibot-20, and MGTAB datasets is shown when using RGT and RGCN as the backbone respectively.
[0111] Depend on Figure 7It can be seen that on the three datasets of Cresci-15, Twibot-20 and MGTAB, the experiment compared the accuracy and F1 score of 1-layer, 2-layer, 3-layer and 4-layer GNN structures. The results show that the model performance is low at 1 layer, indicating that the information has not been fully aggregated; while it reaches the best performance at 2 layers, indicating that the nodes can effectively integrate the key semantic information in the local neighborhood; when the number of layers continues to increase to 3 or 4 layers, the performance decreases instead, which may be due to the problem of feature over-smoothing caused by excessive aggregation, resulting in weakened category discrimination. This trend shows that the method of the present invention is more suitable for using shallow structures in design and has good training efficiency. It also shows that its enhancement and filtering mechanism can fully improve the node representation ability under shallow aggregation conditions, and has good model efficiency and practicality.
[0112] Based on the oversampling method of linear interpolation and the edge filtering strategy driven by reinforcement learning, the present invention has developed a graph neural network enhancement device for social robot detection. It can enhance the features of minority class nodes through the neighborhood-aware interpolation strategy while effectively removing the noise in the original graph structure, thereby achieving high-precision recognition of robot nodes in the social graph. The present invention significantly improves the detection accuracy and robustness while meeting the same computing resource consumption; or on the basis of achieving the same recognition accuracy, it minimizes the dependence on data and structural integrity, and is suitable for typical application scenarios in practice where labels are scarce, categories are severely imbalanced, and network structures are complex. In addition, the present invention can be flexibly integrated into various graph neural network frameworks, and is widely applicable to multiple real-world tasks such as social platform security governance, fake account identification, public opinion guidance, and network content purification.
[0113] In summary, the device of the present invention achieves efficient and accurate identification of robot nodes in a complex social network environment. The proposed feature enhancement method and edge filtering strategy complement each other, which not only effectively improves the discrimination ability and stability of the model, but also has good scalability and engineering deployment value, and can provide strong technical support for the intelligent security of social networks.
[0114] The present invention also provides a graph-enhanced social robot detection device based on reinforcement learning, comprising:
[0115] The representation unit is used to collect multi-source information about users on social networks, including numerical attributes, Boolean attributes, textual profiles, and historical tweets. This unit embeds this multimodal information using a multi-layer perceptron and a pre-trained language model, and employs a multi-head self-attention mechanism for fusion encoding to generate a unified user feature representation vector, providing basic feature support for subsequent modules.
[0116] The enhancement unit is used to alleviate the problem of class imbalance. Based on the neighborhood-aware strategy, this unit performs linear interpolation sampling on minority class robot nodes in the feature space to generate synthetic sample nodes, balance the class distribution of the training set, and ensure that the synthetic nodes remain semantically consistent with the original nodes, thereby enhancing the model's expressive ability for minority classes.
[0117] The filtering unit is used to optimize the social network topology. This unit first calculates the feature similarity between node pairs and generates an edge retention probability based on this similarity. It then uses a learnable edge filtering threshold τ to determine whether to retain an edge. Furthermore, the filtering unit dynamically adjusts the threshold τ through a reinforcement learning module every fixed training cycle to adapt to structural changes during model training, thereby effectively removing noise edges and improving the quality of the graph structure.
[0118] The classification unit is used to input the enhanced node features and filtered graph structure into the graph neural network model, update the node representation through a multi-layer message passing mechanism, and use the Softmax function for binary classification in the output layer to finally complete the automatic identification of social robot nodes.
Claims
1. A graph-enhanced social robot detection method based on reinforcement learning, characterized in that: The steps include: Step 1: Use a multi-layer perceptron and a pre-trained language model to extract metadata and text information of users in the social network, and then fuse the metadata and text information through a multi-head self-attention mechanism to generate user representations; Step 2: Use the neighborhood-aware linear interpolation method to oversample the minority class nodes in the latent feature space to construct a balanced training sample set; Step 3: Dynamically adjust the edge retention threshold based on feature similarity and reinforcement learning strategy, perform edge filtering to remove unreliable connections and optimize the graph structure; Step 4: Input the results of steps 2 and 3 into the graph neural network classifier to identify the social robot nodes.
2. A graph-enhanced social robot detection method based on reinforcement learning according to claim 1, characterized in that: The step 1 is specifically as follows: For a social network graph G(V,E), where V represents the set of user nodes and E represents the set of social connections; each node v i Contains four types of attributes: numerical attributes Boolean properties User Profile User tweets The multi-layer perceptron MLP and pre-trained language model are used to encode and then the multi-head self-attention mechanism is used to generate a unified user representation u. i .
3. The method for detecting social robots using graph-enhanced reinforcement learning according to claim 2, wherein: The pre-trained language model is Roberta.
4. The method for detecting social robots using graph-enhanced reinforcement learning according to claim 3, wherein: The user represents u i The extraction process is as follows: Step 1-1: For each node v i , using multi-layer perceptron MLP to extract metadata information of users in social networks and obtain numerical features and Boolean features Step 1-2: For each node v i , using the pre-trained language model Roberta to extract the text information of users in the social network to obtain user description features And synthesize user tweet features through average pooling Steps 1-3: Concatenate user numerical features Boolean features Describing features and tweet features And the weighted fusion of different modal features is performed through the multi-head self-attention mechanism; Step 1-4: Output the fused user representation u i .
5. The method for detecting social robots using graph-enhanced reinforcement learning according to claim 4, wherein: The step 2 is specifically as follows: In the feature space, for the minority class robot node set V1, its k nearest neighbor nodes of the same type are found, similarity is measured according to the Euclidean distance, and new samples are synthesized using the linear interpolation method to achieve node balanced sampling.
6. The method for detecting social robots using graph-enhanced reinforcement learning according to claim 5, wherein: The linear interpolation method is specifically as follows: Step 2-1: Divide the user set V into the minority class node set V1 and the majority class node set V2; Step 2-2: For each minority class node v i ∈V1, based on the Euclidean distance L(u i ,u j )=||u i -u j ||2, select the k nearest neighbors from the same node to form the neighbor set Γ(v i );u i 、u j Represents node v i and node v j The corresponding initial eigenvector; Step 2-3: Randomly select a node v from the neighbor set x ∈Γ(v i ), perform linear interpolation according to the proportion δ to synthesize new node features: u k =(1-δ)u i +δu x ,δ~U(0,1);u x Represents node v x The corresponding initial eigenvector; Step 2-4: Combine the nodes v k Mark it as the minority class and add it to the training set. Repeat the above process until the number of categories is balanced to obtain the enhanced user representation.
7. The method for detecting social robots using graph-enhanced reinforcement learning according to claim 6, wherein: The step 3 is specifically as follows: First, a single-layer MLP is used to extract node representations, and the feature similarity between neighboring nodes is calculated and converted into edge retention probability p ij A learnable edge retention threshold τ is introduced to determine whether an edge should be retained. Edge retention decisions are supervised by edge-level binary cross-entropy loss. Every T training cycles, the state features are fed into a lightweight reinforcement learning policy network to update τ, thus achieving dynamic adjustment of the edge filtering strategy. The state features include feature mean, feature variance, accuracy change, and loss change.
8. The method for detecting social robots using graph-enhanced reinforcement learning according to claim 7, wherein: The edge filtering strategy is as follows: Step 3-1: For each pair of adjacent nodes (v i ,v j )∈E, perform label prediction on each previous layer feature through a single-layer MLP, and calculate the l1 distance between the two as the similarity metric D i,j =||σ(MLP(h i ))-σ(MLP(h j ))||1, and calculate the edge retention probability: p i,j =1-D i,j ;h i 、h j Represents node v i and node v j The eigenvector after the initial vector of is propagated through the linear layer; Step 3-2: Introduce a learnable edge retention threshold τ to determine whether the edge is retained: If p i,j ≥τ, then keep the edge, otherwise remove it; Step 3-3: Use the same / different edge labels to construct the edge-level binary cross entropy loss function to guide the model to retain the same edges and delete the different edges; Step 3-4: Every T training cycles, collect the current feature mean, variance, accuracy and loss changes to form a state vector s, and pass it through the policy network π θ (s) Generate adjustment action a and update the τ value: τ←τ+(2a-1)λ.
9. The method for detecting social robots using graph-enhanced reinforcement learning according to claim 8, wherein: The step 4 is specifically as follows: Step 4-1: Take the enhanced user representation and the filtered edge set as input and input them into the graph neural network GNN; Step 4-2: Aggregate neighbor information using a message passing mechanism and update node feature representation: Represents node v i The neighbor set of ;AREATE(.) represents the information aggregation operation; Step 4-3: The output layer uses Softmax to predict each node: W and b are both learnable model weight parameters; Step 4-4: Comprehensively consider the original node classification loss, enhanced node classification loss and edge filtering supervision loss, construct a joint loss function, and optimize the overall model performance.
10. A device for detecting a social robot using a graph-enhanced detection method according to claim 1, characterized in that: include: A representation unit is used to collect multi-source information about users on social networks; this multi-source information includes users' numerical attributes, Boolean attributes, textual profiles, and historical tweets. The representation unit embeds this multi-modal information using a multi-layer perceptron and a pre-trained language model, and uses a multi-head self-attention mechanism for fusion encoding to generate a unified user feature representation vector, providing basic feature support for subsequent modules. The enhancement unit is used to alleviate the problem of class imbalance. Based on the neighborhood perception strategy, the enhancement unit performs linear interpolation sampling on the minority class robot nodes in the feature space to generate synthetic sample nodes, balance the class distribution of the training set, and ensure that the synthetic nodes remain semantically consistent with the original nodes, thereby enhancing the model's expressive ability for minority classes. The filtering unit is used to optimize the social network topology. It first calculates the feature similarity between node pairs and generates an edge retention probability based on this similarity. It then uses a learnable edge filtering threshold τ to determine whether to retain an edge. Furthermore, the filtering unit dynamically adjusts the threshold τ through a reinforcement learning module every fixed training cycle to adapt to structural changes during model training, thereby effectively removing noise edges and improving the quality of the graph structure. The classification unit is used to input the enhanced node features and filtered graph structure into the graph neural network model, update the node representation through a multi-layer message passing mechanism, and use the Softmax function for binary classification in the output layer to finally complete the automatic identification of social robot nodes.
Citation Information
Cited By
Relationship enhancement graph-based social robot detection method, apparatus and device, and storage medium
CN121935735A