Social robot detection method based on hyperbolic space and adaptive graph structure

Through the social robot detection method based on hyperbolic space and adaptive graph structure, the problem of difficulty in representing the hierarchical structure and dynamic interactive behavior of social networks in the existing technology is solved, and social robot detection with high accuracy and robustness is achieved.

CN120763757APending Publication Date: 2025-10-10SHAANXI NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511002177.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

Existing social robot detection methods have difficulty in effectively representing the hierarchical structure of social networks in Euclidean space, ignore the characteristics of dynamic interactive behavior, and the static aggregation mechanism cannot adapt to the heterogeneous and adversarial environment of social networks, resulting in a decrease in detection accuracy.

Method used

A social robot detection method based on hyperbolic space and adaptive graph structure is adopted. Through the joint representation learning module, variational edge optimization module and dynamic graph network, multiple user features are integrated, the aggregation mechanism is dynamically adjusted, and the strategic interaction pattern of social robots is identified.

Benefits of technology

It improves the accuracy and robustness of social robot detection, can effectively capture complex relationships, reduce false detection rates, improve the recognition rate of adversarial disguised behaviors, and reduce the complexity of large-scale graph calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120763757A_ABST
    Figure CN120763757A_ABST
Patent Text Reader

Abstract

The invention discloses a social robot detection method based on a hyperbolic space and an adaptive graph structure. The method comprises the steps of obtaining a data set, dividing the data set, extracting user features of various categories, constructing a social robot detection network, training the social robot detection network, testing the constructed social robot detection network, and identifying and detecting a social robot. According to the method, the problem that a traditional Euclidean space is difficult to model a social network hierarchical structure is solved, representation distortion under high-dimensional sparse data is reduced, and the influence of a noise edge on a detection result and the false detection rate are reduced; the problem of overfitting in representation learning and the problem of unbalanced relation types in heterogeneous social networks are solved, and the detection precision is optimized. A contrast experiment result shows that the method has higher robustness for noise interaction and an abnormal topological structure in a complex network environment. Good balance is realized between the detection precision and the generalization ability, and rapid convergence and high model performance can be realized under the condition of limited training data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of social network information security technology, and specifically relates to a social robot detection method based on hyperbolic space learning and dynamic graph neural network. Background Art

[0002] The rapid development of online social networks has provided unprecedented convenience for information dissemination and social interaction, but it has also spawned automated manipulation tools, such as social bots. These bots, leveraging application programming interfaces (APIs) and generative artificial intelligence (AI), are capable of mimicking human social behavior and shaping false public opinion. With technological evolution, social bots have evolved from simple spammers to complex, adaptive systems capable of precisely manipulating public opinion during critical events, such as political elections, public health crises, and social movements.

[0003] The rise of generative AI has made it easy for bots to forge or tamper with metadata. The generated text is also highly similar in syntax and semantics to human users, significantly reducing the accuracy of traditional detection methods. In recent years, graph neural networks have become a mainstream detection technology due to their powerful topological modeling capabilities. They identify anomalous users by aggregating features of neighboring nodes. However, existing methods learn features in Euclidean space, which is difficult to effectively represent the hierarchical structure of social networks, such as user communities and influence levels, limiting the models' discriminative capabilities. Furthermore, existing methods simplify interactions into discrete labels, such as "follow" and "retweet," ignoring key features that bots can exploit to evade detection through dynamic strategies such as intermittent activity or behavioral imitation, making it difficult for models to capture subtle behavioral variations. Furthermore, existing graph neural networks employ a static aggregation mechanism, assigning fixed weights to different types of interactions, such as comments, reposts, and likes, in multi-relational social networks. Static aggregation cannot adaptively adjust message delivery paths, making it difficult for models to distinguish between genuine social behavior and adversarial manipulation.

[0004] Therefore, the current field of social robot detection urgently needs to provide a technical solution that can simultaneously solve the following key problems:

[0005] (1) How to effectively integrate multiple types of user features, such as metadata, text, and social relationships, to avoid representation mismatch due to conflicts in geometric properties.

[0006] (2) How to extract discriminative features from complex interactive behaviors and identify the strategic interaction patterns of robots.

[0007] (3) How to dynamically adjust the aggregation mechanism of graph neural networks to adapt to the heterogeneity and adversarial environment of social networks. Breakthroughs in these issues will significantly improve the accuracy and robustness of social robot detection and provide key technical support for building a trustworthy online social ecosystem. Summary of the Invention

[0008] The technical problem to be solved by the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a social robot detection method based on hyperbolic space and adaptive graph structure with high detection precision, accuracy and robustness.

[0009] The technical solutions adopted to solve the above technical problems are:

[0010] (1) Obtaining a dataset

[0011] Download the TwiBot-20 dataset from the official website of the social robot dataset https: / / github.com / BunsenFeng / TwiBot-20. This dataset contains 229,580 user nodes, covering a more diverse range of user behavior patterns on the Twitter platform. Each user corresponds to multiple types of raw account information, including numerical data, Boolean data, and text data.

[0012] (2) Dividing the data set

[0013] Of the 229,580 users in this dataset, only 11,826 have unique numerical labels. 0 represents a real user and 1 represents a social bot. Of these, 5,237 are real users, 6,589 are social bots, and the remaining 217,754 users are unlabeled. Unlabeled users participate only in model training and are not included in loss calculations. The dataset is divided into a training set of 8,278 users, a validation set of 2,040 users, and a test set of 1,183 users.

[0014] (3) Extracting user features of each category

[0015] According to formula (1), user features of numerical, Boolean, and text data are extracted:

[0016]

[0017] in, They correspond to user description features, tweet text features, numerical features, and Boolean features of user i, respectively. where ∈ R, ∈ C, and ∈ R correspond to the original description features, original tweet text features, original numerical features, and original Boolean features of user i, respectively. LM(·) is the pre-trained language model Roberta, Ave-Pooling(·) is the global pooling operation, || is the concatenation operation, and P is the bitwise padding.

[0018] (4) Building a social robot detection network

[0019] The social robot detection network consists of an encoding layer and a classification prediction layer in series.

[0020] The encoding layer is composed of a joint representation learning module, a variational edge optimization module, and a dynamic graph network connected in series.

[0021] (5) Training the social robot detection network

[0022] 1) Constructing a joint loss function

[0023] Joint loss function Including user classification loss function Classification loss function for unreliable interactions Reconstruction loss function of interaction relationship Latent Space Constrained Loss Function for Interaction Relationships Construct the joint loss function according to formula (2)

[0024]

[0025] Among them, δ recon , δ KL represents the adaptive weight coefficient, δ recon , δ KL ∈(0,1].

[0026] Construct the user classification loss function according to formula (3)

[0027]

[0028] Where n represents the number of users in the training set, and n is a finite positive integer. The predicted label of the i-th user predicted by the model, y i is the true label of the i-th user.

[0029] Construct the classification loss of unreliable interaction relationship according to formula (4)

[0030]

[0031] Q=X e W Q , V=X e W V ,

[0032] Among them, y1 and y0 are indicator functions of edge types with values ​​of 1 or 0, E is the set of interaction relationships, E∈{e1,e2,...,e m}, m is a finite positive integer, |E| is the number of modules of the interaction relationship set, r s is the reliability of the sth interaction relationship, s∈[1,|E|], ω1 and ω2 are learnable weight coefficients, X e is the original edge linear feature matrix, is the original edge nonlinear feature matrix, W Q 、W K 、W V is the weight matrix, d K is the original edge linear feature dimension, d K The value is a finite positive integer.

[0033] Construct the reconstruction loss of the interaction relationship according to formula (5)

[0034]

[0035] Among them, e s is the original interaction relationship feature, is the reconstructed interaction relationship feature, d is the feature dimension of the interaction relationship, and d is a finite positive integer. is the L2 norm.

[0036] The latent space constraint loss of the interaction relationship is constructed according to formula (6)

[0037]

[0038] μ i =W μ e s +b μ ,

[0039]

[0040] Among them, μ i , σ i are the interaction relationships e of user i s The mean and variance of its latent space, R is the number of interaction relationship types, R takes the value of 1 or 2, W μ 、W σ is the weight matrix, b μ 、b σ is the bias term.

[0041] 2) Training the social robot detection network

[0042] The training set is input into the social robot detection network for training; the training parameters are: the training period is 100, the batch size of training is 4096, the learning rate is 1x10 -3 , the weight decay is 5x10 -2 , the size of the hidden layer is 32, the optimizer is AdamW, all model training is carried out on a server with 24GB memory invida3090, 8 CPU cores and 24GB CPU memory, and the joint loss function is converged.

[0043] (6) Test the social robot detection network

[0044] The test set is input into the trained social robot detection network for testing, and the social robot based on the hyperbolic space and the adaptive graph structure is output.

[0045] (7) Identify and detect social robots

[0046] The extracted user multi-class features are input into the trained and tested social robot detection network, a Softmax layer is used for regression, and the identification probability values of real users and social robots are as follows:

[0047] Real user probability Social robot probability

[0048] The final class is predicted according to the following formula, and the real user or social robot is obtained:

[0049]

[0050] Wherein, 1 represents that the final model identification result is a social robot, and 0 represents that the identification result is a real user.

[0051] In step (4) of constructing the social robot detection network of the application, the joint representation learning module is composed of a hyperbolic space transformer and a linear fusion layer, a nonlinear transformation layer in series.

[0052] The hyperbolic space transformer of the application is composed of hyperbolic space layer 1 and hyperbolic space layer 2, hyperbolic space layer 3 and hyperbolic space layer 4 in parallel.

[0053] In step (4) of constructing the social robot detection network of the application, the variational edge optimization module is composed of an edge feature coding layer and a variational auto-encoding layer, and an edge reliability scoring layer in series.

[0054] In step (4) of constructing a social robot detection network of the present invention, the dynamic graph network is composed of a basis decomposition regularization layer, a message passing layer 1, a message passing layer 2, a relationship weight dynamic fusion layer, and a target node transformation layer. The output ends of the basis decomposition regularization layer are respectively connected to the message passing layer 1 and the message passing layer 2, and the output ends of the message passing layer 1 and the message passing layer 2 are connected to the relationship weight dynamic fusion layer in parallel, and the relationship weight dynamic fusion layer is connected in series with the target node transformation layer.

[0055] In step (4) of the present invention, in constructing a social robot detection network, the method for constructing the hyperbolic space transformer is as follows:

[0056] Hyperbolic space transformers include exponential mapping and logarithmic mapping.

[0057] Perform exponential mapping according to formula (8):

[0058]

[0059] in, The hyperbolic space feature of user i, u i is the Euclidean space feature of user i, p represents the feature of the tangent space, K is the coefficient, K∈(0,1].

[0060] Perform logarithmic mapping according to formula (9):

[0061]

[0062] in, Represents the features after hyperbolic transformation, q represents the curvature, q∈(0,1].

[0063] In step (4) of the present invention, in constructing a social robot detection network, the method for constructing the variational edge optimization module is as follows:

[0064] 1) Construction method of edge feature encoder

[0065] Construct the edge feature encoder e according to formula (10) s :

[0066]

[0067] in, Generate features linearly for the original edges, is the nonlinear feature generated by the original edge, α is a hyperparameter, α∈(0,1], is the weight matrix, b b is the bias term, x s is the source node feature, x d is the target node feature, ReLU(·) is the activation function, and A is the third-order weight tensor.

[0068] 2) Construction method of variational autoencoder

[0069] Edge feature e is constructed according to formula (11) r :

[0070] e r = mu + sigma o e, (11)

[0071] Wherein, epsilon is a noise parameter generated according to standard normal distribution.

[0072] In the step (4) of constructing social robot detection network of the application, the construction method of dynamic graph network is as follows:

[0073] 1) Constructing message passing layer 1

[0074] Message passing layer 1 is constructed according to formula (12):

[0075]

[0076] Wherein, W r , W b are weight matrices, is a reliability projection function, c r,b is the combination coefficient of relationship r to base b, c r,b e (0, 1], B is the number of base vectors, B e [1, 4].

[0077] The construction method of message passing layer 2 is the same as that of message passing layer 1.

[0078] 2) Constructing target node transformation layer

[0079] Target node transformation layer h is constructed according to formula (13):

[0080]

[0081] Wherein, h is the updated feature, is the fusion feature of relationship r of the i th user, W o is a weight matrix, v r is the importance vector of relationship r.

[0082] In formula (3) of step (5) of training social robot detection network of the application, n represents the number of users in the training set, n takes the value range of 11826-229580; in formula (4), E e {e1, e2,..., e m}, m takes the value range of 15434-227979, d K is the original edge linear feature dimension, d KThe value range is 32 to 1536. In formula (5), d is the characteristic dimension of the interaction relationship, and the value of d ranges from 32 to 1536.

[0083] This paper employs a joint representation learning module and constructs a hyperbolic geometry embedding framework to address the difficulty of traditional Euclidean space in modeling the hierarchical structure of social networks. This reduces representation distortion in high-dimensional, sparse data and improves the ability to capture complex relationships in social robot detection. This paper also employs a variational edge optimization module, employing a hybrid edge feature generation method and latent space modeling to address the generation and inference of implicit features for social robots. This reduces the impact of noisy edges on detection results, lowers the false detection rate, and improves the recognition of adversarial camouflage behaviors. This paper employs a dynamic graph network and, through neighborhood information aggregation and adaptive fusion, addresses the efficiency issues of modeling relationships between distant nodes and the problem of feature oversmoothing in heterogeneous networks. This reduces the computational complexity of large-scale graphs and improves detection accuracy. Comparative experiments with existing social robot detection methods demonstrate that this method is more robust to noisy interactions and unusual topological structures in complex network environments. It strikes a good balance between detection accuracy and generalization, achieving rapid convergence and high model performance even with limited training data. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] Figure 1 This is a flowchart of Example 1 of the present invention.

[0085] Figure 2 This is a structural diagram of the social robot detection network.

[0086] Figure 3 yes Figure 2 Schematic diagram of the coding layer structure.

[0087] Figure 4 yes Figure 2 Schematic diagram of the structure of the classification prediction layer. DETAILED DESCRIPTION

[0088] The present invention will be further described below with reference to the accompanying drawings and examples, but the present invention is not limited to the following embodiments.

[0089] Example 1

[0090] The social robot detection method based on hyperbolic space and adaptive graph structure of this embodiment consists of the following steps (see Figure 1 ):

[0091] (1) Obtaining a dataset

[0092] The TwiBot-20 dataset is downloaded from the social robot dataset website https: / / github.com / BunsenFeng / TwiBot-20, which contains 229580 user nodes and covers more diverse user behavior patterns on the Twitter platform. Each user corresponds to multiple categories of original account information, including numerical type data, Boolean type data, and text data information.

[0093] (2) Dividing the dataset

[0094] Among the 229580 users in the dataset, only 11826 have their corresponding unique numerical labels, with 0 being a real user and 1 being a social robot. Among them, there are 5237 real users and 6589 social robots, and the remaining 217754 users do not contain labels. Users without labels only participate in model training and do not participate in loss calculation. The dataset is divided into a training set of 8278 users, a validation set of 2040 users, and a test set of 1183 users.

[0095] (3) Extracting user features of each category

[0096] The user features of numerical, Boolean, and text data are extracted according to formula (1):

[0097]

[0098] wherein, correspond to the user description features, tweet text features, numerical features, and Boolean features of user i, correspond to the original user description features, original tweet text features, original numerical features, and original Boolean features of user i, LM(·) is a pre-trained language model Roberta, Ave-Pooling(·) is a global pooling operation, || is a concatenation operation, and P is a bit padding.

[0099] (4) Constructing a social robot detection network

[0100] Figure 2 The structural diagram of the social robot detection network of the present embodiment is given. In Figure 2 , the social robot detection network of the present embodiment is composed of an encoding layer and a classification and prediction layer in series.

[0101] Figure 3 The structural diagram of the encoding layer of the present embodiment is given. In Figure 3 , the encoding layer of the present embodiment is composed of a joint representation learning module and a variational edge optimization module, and a dynamic graph network in series.

[0102] The joint representation learning module in this embodiment consists of a hyperbolic space transformer, a linear fusion layer, and a nonlinear transformation layer connected in series. By employing this joint representation learning module and building a hyperbolic geometric embedding framework, this approach overcomes the difficulty of traditional Euclidean space in modeling the hierarchical structure of social networks. This reduces representation distortion in high-dimensional, sparse data and improves the ability to capture complex relationships in social robot detection.

[0103] The hyperbolic space transformer of this embodiment is composed of a hyperbolic space layer 1, a hyperbolic space layer 2, a hyperbolic space layer 3, and a hyperbolic space layer 4 connected in parallel in sequence.

[0104] The method for constructing the hyperbolic space transformer of this embodiment is as follows:

[0105] Hyperbolic space transformers include exponential mapping and logarithmic mapping.

[0106] Perform exponential mapping according to formula (8):

[0107]

[0108] in, The hyperbolic space feature of user i, u i is the Euclidean space feature of user i, p represents the feature of the tangent space, K is the coefficient, K∈(0,1], and the value of K in this embodiment is 0.5.

[0109] Perform logarithmic mapping according to formula (9):

[0110]

[0111] in, represents the feature after hyperbolic transformation, q represents the curvature, q∈(0,1], and the value of q in this embodiment is 0.5.

[0112] The variational edge optimization module of this embodiment is composed of an edge feature encoding layer, a variational autoencoding layer, and an edge reliability scoring layer connected in series.

[0113] Since the present invention adopts a variational edge optimization module, it solves the generation and inference problems of implicit features of social robots through a hybrid edge feature generation method and latent space modeling, reduces the impact of noise edges on detection results, reduces the false detection rate, and improves the recognition rate of adversarial camouflage behavior.

[0114] The construction method of the variational edge optimization module of this embodiment is as follows:

[0115] 1) Construction method of edge feature encoder

[0116] Construct the edge feature encoder e according to formula (10) s :

[0117]

[0118] in, Generate features linearly for the original edges, is the nonlinear feature generated by the original edge, α is a hyperparameter, α∈(0,1], in this embodiment, α is set to 0.5, is the weight matrix, b b is the bias term, x s is the source node feature, x d is the target node feature, ReLU(·) is the activation function, and A is the third-order weight tensor.

[0119] 2) Construction method of variational autoencoder

[0120] Construct edge feature e according to formula (11) r :

[0121] e r =μ+σ⊙ε, (11)

[0122] Among them, ε is the noise parameter generated by the standard normal distribution.

[0123] The dynamic graph network of this embodiment is composed of a base decomposition regularization layer, a message passing layer 1, a message passing layer 2, a relationship weight dynamic fusion layer, and a target node transformation layer. The output ends of the base decomposition regularization layer are connected to the message passing layer 1 and the message passing layer 2 respectively, and the output ends of the message passing layer 1 and the message passing layer 2 are connected to the relationship weight dynamic fusion layer in parallel, and the relationship weight dynamic fusion layer is connected in series with the target node transformation layer.

[0124] Since the present invention adopts a dynamic graph network, it solves the efficiency problem of modeling relationships between long-distance nodes and the problem of excessive feature smoothing in heterogeneous networks through neighborhood information aggregation and adaptive fusion strategies, reduces the complexity of large-scale graph calculations, and improves detection accuracy.

[0125] The method for constructing the dynamic graph network of this embodiment is as follows:

[0126] 1) Build the messaging layer 1

[0127] Construct the message passing layer 1 according to formula (12):

[0128]

[0129] Among them, W r 、W b is the weight matrix, is the reliability projection function, c r,b is the combination coefficient of relation r on basis b, c r,b ∈(0,1], c in this embodimentr,b = 0.5, B is the number of basis vectors, B e [1, 4], and B of the embodiment is 3.

[0130] The construction method of the message passing layer 2 is the same as that of the message passing layer 1.

[0131] 2) Construction of target node transformation layer

[0132] The target node transformation layer h is constructed according to formula (13):

[0133]

[0134] where h is the updated feature, is the fusion feature of the relationship r of the i-th user, W o is a weight matrix, v r is the importance vector of the relationship r.

[0135] Figure 4 The structure diagram of the classification prediction layer in the embodiment is shown in FIG. 6. Figure 2 In the embodiment, the classification prediction layer is composed of a full connection layer 1, a full connection layer 2 and a Softmax layer in sequence. Figure 4

[0136] (5) Training of social robot detection network

[0137] 1) Construction of joint loss function

[0138] The joint loss function L is constructed according to formula (2): The classification loss function of the user The classification loss function of the unreliable interaction relationship The reconstruction loss function of the interaction relationship The latent space constraint loss function of the interaction relationship The joint loss function L is constructed according to formula (2):

[0139]

[0140] where δ recon , δ KL represent adaptive weight coefficients, δ recon , δ KL e (0, 1], and δ recon , δ KL of the embodiment are 0.5.

[0141] The classification loss function of the user is constructed according to formula (3):

[0142] ​

[0143] Wherein, n represents the number of users in the training set, and the value range of n is 11826 to 229580. In this embodiment, the value of n is 108877. The predicted label of the i-th user predicted by the model, y i is the true label of the i-th user.

[0144] Construct the classification loss of unreliable interaction relationship according to formula (4)

[0145]

[0146] Q=X e W Q , V=X e W V ,

[0147] Among them, y1 and y0 are indicator functions of edge types with values ​​of 1 or 0, E is the set of interaction relationships, E∈{e1,e2,...,e m}, m ranges from 15434 to 227979. In this embodiment, m is 106272. |E| is the number of interaction relationship set modules. s is the reliability of the sth interaction relationship, s∈[1,|E|], ω1 and ω2 are learnable weight coefficients, X e is the original edge linear feature matrix, is the original edge nonlinear feature matrix, W Q 、W K 、W V is the weight matrix, d K is the original edge linear feature dimension, d K The value range is 32 to 1536. In this embodiment, d K The value range is 252.

[0148] Construct the reconstruction loss of the interaction relationship according to formula (5)

[0149]

[0150] Among them, e s is the original interaction relationship feature, is the reconstructed interaction relationship feature, d is the feature dimension of the interaction relationship, and the value range of d is 32 to 1536. In this embodiment, the value of d is 252. is the L2 norm.

[0151] The latent space constraint loss of the interaction relationship is constructed according to formula (6)

[0152]

[0153] μ i =W μ e s +b μ ,

[0154]

[0155] Among them, μ i , σ i are the interaction relationships e of user i s The mean and variance of its latent space, R is the number of interaction relationship types, R is 1 or 2, and R in this embodiment is 2, W μ 、W σ is the weight matrix, b μ 、b σ is the bias term.

[0156] 2) Training the social robot detection network

[0157] The training set is input into the social robot detection network for training; the training parameters are: training cycle is 100, training batch size is 4096, and learning rate is 1×10 -3 , the weight decay is 5×10 -2 , the hidden layer size is 32, the optimizer is AdamW, and all models are trained on a server with 24GB video memory invida3090, 8 CPU cores and 24GB CPU memory to the joint loss function convergence.

[0158] (6) Testing the social robot detection network

[0159] The test set is input into the trained social robot detection network for testing, and a social robot based on hyperbolic space and adaptive graph structure is output.

[0160] (7) Identifying and detecting social robots

[0161] The extracted user multi-class features The input is fed into the trained and tested social robot detection network, and regression is performed using the Softmax layer. The recognition probability values ​​of real users and social robots are obtained as follows:

[0162] Real user probability Socialbot Probability

[0163] The final category is predicted as follows to obtain the real user or social robot:

[0164]

[0165] Among them, 1 means that the final model recognition result is a social robot, and 0 means that the recognition result is a real user.

[0166] Completed a social robot detection method based on hyperbolic space and adaptive graph structure.

[0167] Example 2

[0168] The social robot detection method based on hyperbolic space and adaptive graph structure of this embodiment consists of the following steps:

[0169] (1) Obtaining a dataset

[0170] This step is the same as in Example 1.

[0171] (2) Dividing the data set

[0172] This step is the same as in Example 1.

[0173] (3) Extracting user features of each category

[0174] This step is the same as in Example 1.

[0175] (4) Building a social robot detection network

[0176] The structure of the social robot detection network is the same as that of Example 1.

[0177] The method for constructing the hyperbolic space transformer of this embodiment is as follows:

[0178] Hyperbolic space transformers include exponential mapping and logarithmic mapping.

[0179] Perform exponential mapping according to formula (8):

[0180] The expression of formula (8) is the same as that of Example 1.

[0181] In formula (8), K is a coefficient, K∈(0,1], and the value of K in this embodiment is 0.1; other parameters and variables and their value ranges are the same as those in embodiment 1.

[0182] Perform logarithmic mapping according to formula (9):

[0183] The expression of formula (9) is the same as that of Example 1.

[0184] In formula (9), q represents curvature, q∈(0,1], the value of q in this embodiment is 0.1, and other parameters and variables and value ranges are the same as those in embodiment 1.

[0185] The construction method of the variational edge optimization module of this embodiment is as follows:

[0186] 1) Construction method of edge feature encoder

[0187] Construct the edge feature encoder e according to formula (10) s :

[0188] The expression of formula (10) is the same as that of Example 1.

[0189] In formula (10), α is a hyperparameter, α∈(0,1], and the value of α in this embodiment is 0.1. Other parameters and variables and their value ranges are the same as those in embodiment 1.

[0190] The other steps of this step are the same as those in Example 1.

[0191] The method for constructing the dynamic graph network of this embodiment is as follows:

[0192] 1) Build the messaging layer 1

[0193] Construct the message passing layer 1 according to formula (12):

[0194] The expression of formula (12) is the same as that of Example 1.

[0195] In formula (12), c r,b is the combination coefficient of relation r on basis b, c r,b ∈(0,1], c in this embodiment r,b The value is 0.1, B is the number of basis vectors, B∈[1,4], and the value of B in this embodiment is 1. Other parameters and variables and their value ranges are the same as those in Example 1.

[0196] The other steps of this step are the same as those in Example 1.

[0197] (5) Training the social robot detection network

[0198] 1) Constructing a joint loss function

[0199] Construct the joint loss function according to formula (2)

[0200] The expression of formula (2) is the same as that of Example 1.

[0201] In formula (2), δ recon , δ KL represents the adaptive weight coefficient, δ recon , δ KL ∈(0,1], δ in this embodiment recon , δ KL The value is 0.1.

[0202] Construct the user classification loss function according to formula (3)

[0203] The expression of formula (3) is the same as that of Example 1.

[0204] In formula (3), n represents the total number of users in the training set. The value range of n is 11826 to 229580. In this embodiment, the value of n is 11826. Other parameters, variables and value ranges are the same as those in embodiment 1.

[0205] Construct the classification loss of unreliable interaction relationship according to formula (4)

[0206] The expression of formula (4) is the same as that of Example 1.

[0207] In formula (4), E is the set of interaction relations, E∈{e1,e2,...,e m}, the value range of m is 15434 to 227979. The value of m in this embodiment is 15434. Other parameters, variables and value ranges are the same as those in Example 1.

[0208] Construct the reconstruction loss of the interaction relationship according to formula (5)

[0209] The expression of formula (5) is the same as that of Example 1.

[0210] In formula (5), d K is the original edge linear feature dimension, d K The value range is 32 to 1536. In this embodiment, d K The value range is 32, d is the characteristic dimension of the interaction relationship, and the value of d ranges from 32 to 1536. The value of d in this embodiment is 32, and other parameters, variables and value ranges are the same as those in Example 1.

[0211] The latent space constraint loss of the interaction relationship is constructed according to formula (6)

[0212] The expression of formula (6) is the same as that of Example 1.

[0213] In formula (6), R is the number of interaction relationship types, and the value of R is 1 or 2. In this embodiment, the value of R is 1. Other parameters, variables, and value ranges are the same as those in embodiment 1.

[0214] The other steps of this step are the same as those in Example 1.

[0215] The other steps are the same as those in Example 1. The social robot detection method based on hyperbolic space and adaptive graph structure is completed.

[0216] Example 3

[0217] The social robot detection method based on hyperbolic space and adaptive graph structure of this embodiment consists of the following steps:

[0218] (1) Obtaining a dataset

[0219] This step is the same as in Example 1.

[0220] (2) Dividing the data set

[0221] This step is the same as in Example 1.

[0222] (3) Extracting user features of each category

[0223] This step is the same as in Example 1.

[0224] (4) Building a social robot detection network

[0225] The structure of the social robot detection network is the same as that of Example 1.

[0226] The method for constructing the hyperbolic space transformer of this embodiment is as follows:

[0227] Hyperbolic space transformers include exponential mapping and logarithmic mapping.

[0228] Perform exponential mapping according to formula (8):

[0229] The expression of formula (8) is the same as that of Example 1.

[0230] In formula (8), K is a coefficient, K∈(0,1], and the value of K in this embodiment is 1; other parameters and variables and their value ranges are the same as those in embodiment 1.

[0231] Perform logarithmic mapping according to formula (9):

[0232] The expression of formula (9) is the same as that of Example 1.

[0233] In formula (9), q represents curvature, q∈(0,1], and the value of q in this embodiment is 1. Other parameters, variables, and value ranges are the same as those in embodiment 1.

[0234] The construction method of the variational edge optimization module of this embodiment is as follows:

[0235] 1) Construction method of edge feature encoder

[0236] Construct the edge feature encoder e according to formula (10) s :

[0237] The expression of formula (10) is the same as that of Example 1.

[0238] In formula (10), α is a hyperparameter, α∈(0,1], and the value of α in this embodiment is 1. Other parameters and variables and their value ranges are the same as those in embodiment 1.

[0239] The other steps of this step are the same as those in Example 1.

[0240] The method for constructing the dynamic graph network of this embodiment is as follows:

[0241] 1) Build the messaging layer 1

[0242] Construct the message passing layer 1 according to formula (12):

[0243] The expression of formula (12) is the same as that of Example 1.

[0244] In formula (12), c r,b is the combination coefficient of relation r on basis b, c r,b ∈(0,1], c in this embodiment r,b The value is 1, B is the number of basis vectors; B∈[1,4], and the value of B in this embodiment is 4. Other parameters and variables and their value ranges are the same as those in Example 1.

[0245] The other steps of this step are the same as those in Example 1.

[0246] (5) Training the social robot detection network

[0247] 1) Constructing a joint loss function

[0248] Construct the joint loss function according to formula (2)

[0249] The expression of formula (2) is the same as that of Example 1.

[0250] In formula (2), δ recon , δ KL represents the adaptive weight coefficient, δ recon , δ KL ∈(0,1], δ in this embodiment recon , δ KL The value is 1.

[0251] Construct the user classification loss function according to formula (3)

[0252] The expression of formula (3) is the same as that of Example 1.

[0253] In formula (3), n represents the total number of users in the training set. The value range of n is 11826 to 229580. In this embodiment, the value of n is 229580. Other parameters and variables and their value ranges are the same as those in embodiment 1.

[0254] Construct the classification loss of unreliable interaction relationship according to formula (4)

[0255] The expression of formula (4) is the same as that of Example 1.

[0256] In formula (4), E is the set of interaction relations, E∈{e1,e2,...,e m}, the value range of m is 15434~227979. The value of m in this embodiment is, and other parameters, variables and value ranges are the same as those in Example 1.

[0257] Construct the reconstruction loss of the interaction relationship according to formula (5)

[0258] The expression of formula (5) is the same as that of Example 1.

[0259] In formula (5), d K is the original edge linear feature dimension, d K The value range is 32 to 1536. In this embodiment, d K The value range is 1536, d is the characteristic dimension of the interaction relationship, and the value of d ranges from 32 to 1536. The value of d in this embodiment is 1536. Other parameters, variables and value ranges are the same as those in Example 1.

[0260] The latent space constraint loss of the interaction relationship is constructed according to formula (6)

[0261] The expression of formula (6) is the same as that of Example 1.

[0262] In formula (6), R is the number of interaction relationship types, and the value of R is 1 or 2. In this embodiment, the value of R is 2. Other parameters, variables, and value ranges are the same as those in embodiment 1.

[0263] The other steps of this step are the same as those in Example 1.

[0264] Other steps are the same as those in Example 1. Social robot detection method based on hyperbolic space and adaptive graph structure.

[0265] In order to verify the beneficial effects of the present invention, comparative experiments were carried out using the social robot detection method based on hyperbolic space and adaptive graph structure of Example 1 of the present invention (hereinafter referred to as the method of the present invention) and Botmoe: Twitter bot detection with community-aware mixtures of modal-specific experts (hereinafter referred to as comparative experiment 1), Twitter bot detection using bidirectional long short-term memory neural networks and word embeddings (hereinafter referred to as comparative experiment 2), Botometer 101: Social bot practice for computational social scientists (hereinafter referred to as comparative experiment 3), Online human-bot interactions: Detection, estimation, and characterization (hereinafter referred to as comparative experiment 4), Botbuster: Multi-platform bot detection using a mixture of experts (hereinafter referred to as comparative experiment 5), Heterogeneous graph transformer (hereinafter referred to as comparative experiment 6), and Scalable and generalizable social bot detection through data selection (hereinafter referred to as comparative experiment 7). The experimental results are shown in Table 1.

[0266] Table 1 Experimental results of the present invention and comparative experiments

[0267]

[0268] As can be seen from Table 1, among all the experimental results, the average result of the final five experiments of the method of the present invention in TwiBot-20 was 91.53% accuracy and 92.14% F1 score. The method of the present invention has the highest accuracy and F1 score. Compared with the comparative experiment 7 in TwiBot-20, the accuracy of the method of the present invention is 9.93% higher and the F1 score is 7.24% higher. Compared with the comparative experiment 4 in TwiBot-20, the accuracy is 12.83% higher and the F1 score is 11.06% higher. The method of the present invention can effectively utilize user features while weakening the impact of abnormal topology between users on the model. The joint representation learning module proposed in the present invention uses hyperbolic geometric space to more effectively capture the multi-category latent semantic features of users. The variational edge optimization module proposed in the present invention achieves accurate characterization and efficient representation of complex nonlinear relationships in interactive behaviors through dual optimization of latent variable space modeling and attention fusion mechanism. The dynamic graph network proposed in this invention uses an adaptive relationship credibility mechanism to automatically enhance important connections and suppress noisy connections during feature aggregation, thereby improving the model's robustness to false social behaviors.

Claims

1. A social robot detection method based on hyperbolic space and adaptive graph structure, characterized by It consists of the following steps: (1) Obtaining a dataset Download the TwiBot-20 dataset from the official website of the social robot dataset https: / / github.com / BunsenFeng / TwiBot-20. This dataset contains 229,580 user nodes, covering a wide range of user behavior patterns on the Twitter platform. Each user corresponds to multiple types of raw account information, including numerical data, Boolean data, and text data. (2) Dividing the data set Of the 229,580 users in this dataset, only 11,826 have unique numerical labels corresponding to them. 0 represents a real user and 1 represents a social bot. Of these, 5,237 are real users, 6,589 are social bots, and the remaining 217,754 users are unlabeled. Unlabeled users participate only in model training and are not included in loss calculations. The dataset is divided into a training set of 8,278 users, a validation set of 2,040 users, and a test set of 1,183 users. (3) Extracting user features of each category According to formula (1), user features of numerical, Boolean, and text data are extracted: in, They correspond to user description features, tweet text features, numerical features, and Boolean features of user i, respectively. They correspond to the original description features, original tweet text features, original numerical features, and original Boolean features of user i, respectively. LM(·) is the pre-trained language model Roberta, Ave-Pooling(·) is the global pooling operation, || is the concatenation operation, and P is the bit-wise padding. (4) Building a social robot detection network The social robot detection network consists of an encoding layer and a classification prediction layer in series; The encoding layer is composed of a joint representation learning module, a variational edge optimization module, and a dynamic graph network connected in series; (5) Training the social robot detection network 1) Constructing a joint loss function Joint loss function Classification loss function including users Classification loss function for unreliable interactions Reconstruction loss function of interaction relationship Latent Space Constrained Loss Function for Interaction Relationships Construct the joint loss function according to formula (2) Among them, δ recon , δ KL represents the adaptive weight coefficient, δ recon , δ KL ∈(0,1]; Construct the user classification loss function according to formula (3) Where n represents the number of users in the training set, and n is a finite positive integer. The predicted label of the i-th user predicted by the model, y i is the true label of the i-th user; Construct the classification loss of unreliable interaction relationship according to formula (4) Among them, y1 and y0 are indicator functions of edge types with values ​​of 1 or 0, E is the set of interaction relationships, E∈{e1,e2,...,e m }, m is a finite positive integer, |E| is the number of modules of the interaction relationship set, r s is the reliability of the sth interaction relationship, s∈[1,|E|], ω1 and ω2 are learnable weight coefficients, X e is the original edge linear feature matrix, is the original edge nonlinear feature matrix, W Q 、W K 、W V is the weight matrix, d K is the original edge linear feature dimension, d K The value is a finite positive integer; Construct the reconstruction loss of the interaction relationship according to formula (5) Among them, e s is the original interaction relationship feature, is the reconstructed interaction relationship feature, d is the feature dimension of the interaction relationship, and d is a finite positive integer. is the L2 norm; The latent space constraint loss of the interaction relationship is constructed according to formula (6) Among them, μ i , σ i are the interaction relationships e of user i s The mean and variance of its latent space, R is the number of interaction relationship types, R takes the value of 1 or 2, W μ 、W σ is the weight matrix, b μ 、b σ is the bias term; 2) Training the social robot detection network The training set is input into the social robot detection network for training; the training parameters are: training cycle is 100, training batch size is 4096, and learning rate is 1×10 -3 , the weight decay is 5×10 -2 , the hidden layer size is 32, the optimizer is AdamW, and all models are trained on a server with 24GB video memory invida3090, 8 CPU cores and 24GB CPU memory to the joint loss function convergence; (6) Testing the social robot detection network Input the test set into the trained social robot detection network for testing, and output a social robot based on hyperbolic space and adaptive graph structure; (7) Identifying and detecting social robots The extracted user multi-class features The input is fed into the trained and tested social robot detection network, and regression is performed using the Softmax layer. The recognition probability values ​​of real users and social robots are obtained as follows: Real user probability Socialbot Probability The final category is predicted as follows to obtain the real user or social robot: Among them, 1 means that the final model recognition result is a social robot, and 0 means that the recognition result is a real user.

2. The social robot detection method based on hyperbolic space and adaptive graph structure according to claim 1, characterized in that: In step (4) of constructing the social robot detection network, the joint representation learning module is composed of a hyperbolic space transformer, a linear fusion layer, and a nonlinear transformation layer connected in series.

3. The social robot detection method based on hyperbolic space and adaptive graph structure according to claim 2, characterized in that: The hyperbolic space transformer is composed of a hyperbolic space layer 1, a hyperbolic space layer 2, a hyperbolic space layer 3, and a hyperbolic space layer 4 connected in parallel in sequence.

4. The social robot detection method based on hyperbolic space and adaptive graph structure according to claim 1, characterized in that: In step (4) of constructing the social robot detection network, the variational edge optimization module is composed of an edge feature encoding layer, a variational autoencoding layer, and an edge reliability scoring layer connected in series.

5. The social robot detection method based on hyperbolic space and adaptive graph structure according to claim 1, characterized in that: In step (4) of constructing a social robot detection network, the dynamic graph network is composed of a basis decomposition regularization layer, a message passing layer 1, a message passing layer 2, a relationship weight dynamic fusion layer, and a target node transformation layer. The output end of the basis decomposition regularization layer is connected to the message passing layer 1 and the message passing layer 2 respectively, and the output ends of the message passing layer 1 and the message passing layer 2 are connected to the relationship weight dynamic fusion layer in parallel, and the relationship weight dynamic fusion layer is connected in series with the target node transformation layer.

6. The social robot detection method based on hyperbolic space and adaptive graph structure according to claim 1 is characterized in that In step (4) of constructing the social robot detection network, the hyperbolic space transformer is constructed as follows: Hyperbolic space transformers include exponential mapping and logarithmic mapping; Perform exponential mapping according to formula (8): in, The hyperbolic space feature of user i, u i is the Euclidean space feature of user i, p represents the feature of the tangent space, K is the coefficient, K∈(0,1]; Perform logarithmic mapping according to formula (9): in, Represents the features after hyperbolic transformation, q represents the curvature, q∈(0,1].

7. The social robot detection method based on hyperbolic space and adaptive graph structure according to claim 1 is characterized in that In step (4) of constructing the social robot detection network, the construction method of the variational edge optimization module is as follows: 1) Construction method of edge feature encoder Construct the edge feature encoder e according to formula (10) s : in, Generate features linearly for the original edges, is the nonlinear feature generated by the original edge, α is a hyperparameter, α∈(0,1], is the weight matrix, b b is the bias term, x s is the source node feature, x d is the target node feature, ReLU(·) is the activation function, and A is the third-order weight tensor; 2) Construction method of variational autoencoder Construct edge feature e according to formula (11) r : and r =μ+σ⊙ε, (11) Among them, ε is the noise parameter generated by the standard normal distribution.

8. The social robot detection method based on hyperbolic space and adaptive graph structure according to claim 1 is characterized in that In step (4) of constructing the social robot detection network, the method for constructing the dynamic graph network is as follows: 1) Build the messaging layer 1 Construct the message passing layer 1 according to formula (12): Among them, W r 、W b is the weight matrix, is the reliability projection function, c r,b is the combination coefficient of relation r on basis b, c r,b ∈(0,1], B is the number of basis vectors, B∈[1,4]; The construction method of the message transmission layer 2 is the same as the construction method of the message transmission layer 1; 2) Construct the target node transformation layer Construct the target node transformation layer h according to formula (13): Among them, h is the updated feature, is the fusion feature of the relationship r of the i-th user, W o is the weight matrix, v r is the importance vector of relation r.

9. The social robot detection method based on hyperbolic space and adaptive graph structure according to claim 1, characterized in that: In step (5), in formula (3) for training the social robot detection network, n represents the number of users in the training set, and the value range of n is 11826 to 229580; in formula (4), E∈{e1,e2,...,e m }, m ranges from 15434 to 227979, d K is the original edge linear feature dimension, d K The value range is 32 to 1536. In formula (5), d is the characteristic dimension of the interaction relationship, and the value of d ranges from 32 to 1536.