Social Robot Detection Method and Device Based on Community Walk
Through the DANMF community detection algorithm and community wandering rules, the macro community structure of the social network is captured and the representation vector of the account is learned, which solves the problems of low detection accuracy and high feature engineering cost of social robots in the existing technology, and achieves higher detection accuracy and better model generalization capabilities.
Patent Information
- Application Number
- CN202211509963.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-11-29
AI Technical Summary
The existing social robot detection methods ignore the macro community structure information in social networks, resulting in low detection accuracy, high feature engineering costs, and limited model generalization capabilities.
The DANMF community detection algorithm is used to capture the macro community structure of social networks, design rules for wandering inside and outside the community, learn the representation vector of the account through the graph embedding method, and use a classifier to detect it.
It improves the accuracy of social robot detection, reduces the cost of feature engineering, and enhances the generalization ability of the model.
Smart Images

Figure CN116152002B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of social networks, and particularly relates to a method and device for detecting social robots based on community walking. Background Art
[0002] With the development of network technology and the popularization of mobile Internet, the number of users of social media has increased exponentially. According to statistics, as of the second quarter of 2021, the monthly active users of Facebook are approximately 2.89 billion, and the daily active users of Twitter are 145 million. This huge active user base has triggered an explosive use of online social networks in marketing, news, public relations, entertainment, and global and national major events, which has brought opportunities for the development of social robots. According to data, in 2019, robot accounts accounted for 15% of the average active accounts on Faceobook and 11% of the average active accounts on Twitter. The purposeful behaviors of malicious robots on social networks, such as election manipulation, rumor spreading, personal information theft, etc., seriously endanger the reputation evaluation system of OSN and the trust relationship of users. Therefore, the research on detecting malicious robots in social networks has direct practical significance for network information security, network opinion guidance, and user privacy information protection.
[0003] With the development of social robots and social robot detection technology, the detection methods of social robots show two major trends: methods based on account features and methods based on graph structures.
[0004] Generally speaking, for methods based on account features, the more statistical features are used, the better the performance of such robot detection models. However, this type of method needs to mine potential features from a large amount of data, and the cost of feature engineering is very high, and the generalization ability of the model is limited due to different features in different OSNs. Most of the existing graph-based social robot detection models start from the neighbor structure information of nodes for label propagation or node embedding, ignoring the macro community structure information of nodes in social networks. The latest research begins to consider the macro community structure of nodes in social networks and uses the modular Louvain community detection algorithm to extract the community structure in online social networks, but it ignores the impact of overlapping communities on social robot detection and the attention characteristics of accounts between communities. Summary of the Invention
[0005] Aiming at the problems existing in the prior art, the present invention proposes a method and device for detecting social robots based on community walking. This method uses the DANMF community detection algorithm to capture the macro community structure in social networks. By designing community walking rules, it can more reasonably reflect the interaction characteristics of accounts and has higher accuracy in social robot detection.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] The present invention provides a method for detecting social robots based on community walk, including the following steps:
[0008] Capture the macroscopic community structure information in the social network based on the DANMF community detection algorithm;
[0009] Design the in-community walk rules and inter-community walk rules to capture the structure information and neighbor information of each account;
[0010] Use the graph embedding method to learn the representation vector of each account according to its structure information and neighbor information;
[0011] Use the representation vectors of the labeled social robots and normal users to train a classifier for social robot detection.
[0012] Further, the DANMF community detection algorithm integrates the encoder component and the decoder component into a unified loss function, enabling the two components to guide each other during the learning process, thereby obtaining the community member nodes.
[0013] Further, the DANMF community detection algorithm reduces the gap between the shallow features and deep features of the original social network data through deep learning, and performs multi-layer decomposition on the mapping matrix M. After M is decomposed, it becomes M1M2…M p , where P is the number of decomposition layers; specifically expressed as: the adjacency matrix A of the social network graph is decomposed into P + 1 non-negative matrices, A≈M1M2…M p H p , where M p H p is H p-1 , that is, the community member matrix of the P - 1 layer.
[0014] Further, the optimization objective function of DANMF is obtained through the decoder optimization objective function and the encoder optimization objective function, and the mapping matrix M is updated using the multiplicative update rule i , i = 1, 2…, p, and the community member matrix H is updated using the multiplicative update rule p , and the mapping matrix M is iteratively updated through the update rule i and the community member matrix H p , and the update stops when the optimization objective is reached, and finally the communities in the social network are extracted.
[0015] Further, according to the extracted communities, use the in-community walk rules and inter-community walk rules to visit each account in the social network, and obtain a representation sequence containing the structure information and neighbor information of each account.
[0016] Further, the community walking rule is represented by the transition probability Γ, and the expression of Γ is as follows:
[0017]
[0018] Where V i represents node i, v i+1 represents the next node of node i, E represents the set of nodes, represents the community to which node i belongs, ψ represents the regularization constant, represents the intra-community walking transition probability, represents the inter-community walking transition probability. When the next node and the current node belong to the same community, is used as the transition probability. When the next node and the current node belong to two communities, is used as the transition probability.
[0019] Further, the representation sequences of all accounts obtained by community walking are input into the Skip-gram graph embedding model for training to learn the representation vectors of each account that can retain the structural information and neighbor information.
[0020] Further, the representation vector is expressed by the formula: Where V is the adjacency matrix of the social network graph, and the i-th row X of X i represents the representation vector of the i-th node, and d represents the dimension of the representation vector.
[0021] The present invention also provides a social robot detection device based on community walking, including:
[0022] A community division module for capturing the macroscopic community structure information in the social network based on the DANMF community detection algorithm;
[0023] An account information capture module for designing the intra-community walking rule and the inter-community walking rule to capture the structural information and neighbor information of each account;
[0024] A graph embedding module for using the graph embedding method to learn its representation vector according to the structural information and neighbor information of each account;
[0025] A classifier module for using the representation vectors of the labeled social robots and normal users to train a classifier for social robot detection.
[0026] Compared with the prior art, the present invention has the following advantages:
[0027] The present invention first introduces the DANMF community detection algorithm to extract the macro community structure information in the social network, then adopts different random walk rules within and between communities to obtain a representation sequence containing account structure information and neighbor information, reflecting the account interaction characteristics in the social network. Finally, using the graph embedding method, the representation sequence generated by community random walk is input into the graph embedding model to obtain the representation vector of each account, and the representation vector is input into the classifier for the detection of social robots. The present invention makes good use of community discovery and community random walk to preserve the structure information and neighbor information of accounts in the social network, and has a higher accuracy in detecting social robots compared with the state-of-the-art graph representation learning models. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.
[0029] Figure 1 is a schematic flowchart of the social robot detection method based on community random walk according to the embodiment of the present invention;
[0030] Figure 2 is a framework diagram of the social robot detection model based on community random walk according to the embodiment of the present invention;
[0031] Figure 3 is a schematic diagram of the node random walk within and between communities according to the embodiment of the present invention;
[0032] Figure 4 is a structural block diagram of the social robot detection device based on community random walk according to the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0033] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the scope of protection of the present invention.
[0034] As Figure 1 and Figure 2 shown, a social robot detection method based on community random walk in this embodiment includes the following steps:
[0035] Step S1, capturing the macro community structure information in the social network based on the DANMF community detection algorithm.
[0036] Step S2, design intra - community and inter - community wandering rules within the community to capture the structural information and neighbor information of each account, reflecting the characteristics of account interactions.
[0037] Step S3, use the graph embedding method to learn its representation vector based on the structural information and neighbor information of each account.
[0038] Step S4, use the representation vectors of labeled social bots and normal users to train a classifier for social bot detection.
[0039] The community detection in Step S1 includes the following:
[0040] Use the DANMF community detection algorithm to mine the structural similarity of nodes in the social network for community division. DANMF is a community detection algorithm based on NMF, which can detect overlapping communities in the social network and is superior to louvain in non - overlapping communities.
[0041] The DANMF community detection algorithm integrates the encoder component and the decoder component into a unified loss function, enabling the two components to guide each other during the learning process, thereby obtaining ideal community member nodes. NMF directly learns a one - layer mapping matrix M and a community member matrix H between nodes. However, real - world networks usually consist of complex and diverse organizational patterns. Therefore, the mapping between the original social network and the community member space is very likely to contain quite complex hierarchical and structural information, which has implicit low - level hidden attributes. The DANMF community detection algorithm reduces the gap between the shallow features and deep features of the original social network data through deep learning, and performs multi - layer decomposition on the mapping matrix M. After M is decomposed, it becomes M1M2…M p , where P is the number of decomposition layers; specifically expressed as: the adjacency matrix A of the social network graph is decomposed into P + 1 non - negative matrices, A≈M1M2…M p H p , where M p H p is H p-1 , that is, the community member matrix of the P - 1 layer.
[0042] In order to obtain an ideal community member matrix through non - negative matrix factorization, the decoder optimizes the objective function as follows:
[0043]
[0044]
[0045] Where:
[0046] H2≈M3…M p H p
[0047] H1≈M2…M p H p
[0048] H p-1 ≈M p H p
[0049] The optimization objective function of the encoder is as follows:
[0050]
[0051]
[0052] The optimization objective function of DANMF is obtained from the optimization objective function of the decoder and the encoder as follows:
[0053]
[0054]
[0055] where, is the graph regularization term, λ is the regularization parameter, L represents the Laplacian matrix of the graph, L = D - AD is a diagonal matrix, and its elements are the sum of the elements in the A row.
[0056] Update the mapping matrix M using the multiplicative update rule i , and the formula is as follows:
[0057]
[0058] where, ⊙ represents the element-wise multiplication of two matrices, Ω i-1 = M1M2…M i-1 and Φ i+1 = M i+1 …M p-1 M p , when i = 1, let Ω0 = I, when i = p, let Φ p+1 = I.
[0059] Similarly, the update rule of the community membership matrix H p is as follows:
[0060]
[0061] Iteratively update the mapping matrix M i and the community membership matrix H p , stop updating when the optimization objective is reached, and finally extract the communities in the social network.
[0062] Step S2 community walk specifically includes:
[0063] According to the extracted communities, each account in the social network is visited using the intra-community random walk rule and the inter-community random walk rule within the community, and a representation sequence containing the structural information and neighbor information of each account is obtained. Assume that the random walk process of the given source node S starts from its own context node, so s = v0. Two parameters are used to control the random walk in the community: in-out (q) and return (p). The second-order intra-community random walk transition probability is used within the community.
[0064]
[0065] The parameter q controls the distance of the random walk from the given source node s to the n-hop neighbor. When q > 1, the random walk in the community tends to visit the surrounding nodes of the previous v i node of the current node v i-1 and vice versa when q < 1. The return parameter p controls the probability of the random walk revisiting the node v i , that is, v i+1 = v i . A large value of the parameter p helps to reduce the probability of repeated sampling of the same node during the random walk in the community. The inter-community transition probability is as follows:
[0066]
[0067] where is a penalty term. The more edges and nodes in the community, the smaller the probability of a single node walking to the nodes within its community. In the real social network, the probability of an account interacting with the accounts within the community is greater than the probability of interacting with the accounts outside the community. Statistical findings show that there is a phenomenon of mutual following among social robots. In communities with the same number of nodes, the number of edges in the robot community is significantly greater than the number of edges in the normal user community. Using this penalty term can reflect the fact that the probability of a user following a user in a normal community is greater than the probability of following a user in a robot community.
[0068] The transition probability Γ is obtained from the above intra-community transition probability and inter-community transition probability as follows:
[0069]
[0070] where V i represents node i, v i+1 represents the next node of node i, E represents the set of nodes, represents the community to which node i belongs, and ψ represents the regularization constant; as Figure 3 shown, when the next node and the current node belong to the same community, is used as the transition probability, and when the next node and the current node belong to two communities, as the transition probability.
[0071] The specific steps of the S3 graph embedding method include:
[0072] The representation sequences of all accounts obtained by community walking are input into the Skip-gram graph embedding model for training, and the representation vectors of each account that can retain the structural information and neighbor information are learned, which is expressed by the formula: where V is the adjacency matrix of the social network graph, and the i-th row of X, X I represents the representation vector of the i-th node, d represents the dimension of the representation vector, and each dimension of the representation vector of each node represents a potential feature. The optimization objective of learning the structural information and neighbor information of each node v in the given social network is as follows:
[0073]
[0074] where logP(t|c; θ) represents the logarithm of the conditional probability of the context node occurring given the central node c. For a specific node c, the conditional probability of its context node t is defined as the softmax function, and the formula is as follows:
[0075]
[0076] X T and X C represent the t-th row and the c-th row of the d-dimensional embedding matrix learned from the given social network, respectively. u is a specific user node in V, u ∈ V.
[0077] The stochastic gradient descent (SGD) optimization strategy and negative sampling strategy are used to accelerate the optimization. The negative sampling strategy randomly samples k samples from a group of users in the given social network, and its update strategy is as follows:
[0078]
[0079] σ is the sigmoid function. F(u) is the sampling distribution, which is specified by the node type of the neighbor node t. The negative sampling strategy greatly reduces the number of training samples in each iteration and speeds up the optimization process.
[0080] The gradient derivation is as follows:
[0081]
[0082]
[0083] ξ(·) is the indicator function, indicating that the given negative sample u K is the neighborhood context node t of the given node c, u K= t, X C and respectively represent the row embedding vector of the characteristic node c and the negative sample u K .
[0084] A large number of experiments were conducted on two baseline datasets below to verify the performance of this method. All experiments were carried out on a server with a 2.2GHz Intel Xeon E5-2650v4 CPU running Windows server 2012 (64-bit) and 256GB of main memory. Two publicly available datasets, the cresci-2015 dataset and the twitter large-scale network dataset, were used to verify the effectiveness of the model. Table 1 lists the detailed information of the two datasets.
[0085] Table 1
[0086]
[0087] When comparing the model we proposed with DeepWalk, Node2vec, Struc2vec, and Bot2vec, the model of the present invention can automatically learn the implicit features of nodes in different types of social networks, and uses community discovery and community walk to well preserve the structural information and neighbor information of nodes in the social network, thus avoiding the challenges of feature engineering and improving the generality of the model. Experiments were conducted on the cresci-2015 dataset and the twitter dataset. The areas under the ROC curves (AUC) of this model were 0.996 and 0.946 respectively, which were 1.28% and 3.47% higher than those of the state-of-the-art Bot2vec respectively. The accuracies (Accuracy) of this model reached 0.992 and 0.901 respectively, which were 0.78% and 2.69% higher than those of the state-of-the-art social bot detection model Bot2vec in terms of accuracy. The F1-values of this model reached 0.990 and 0.899 respectively, which were 1.01% and 2.92% higher than those of the state-of-the-art social bot detection model Bot2vec respectively. Experiments prove that the introduction of the DANMF community detection algorithm and the newly designed community walk rule in this model is effective.
[0088] Corresponding to the above social bot detection method based on community walk, as Figure 4 shown, this embodiment also proposes a social bot detection device based on community walk, including a community division module, an account information capture module, a graph embedding module, and a classifier module.
[0089] The community division module is used to capture the macroscopic community structure information in the social network based on the DANMF community detection algorithm;
[0090] An account information capture module, which is used to design community roaming rules within a community and community roaming rules between communities to capture the structural information and neighbor information of each account;
[0091] A graph embedding module, which is used to use graph embedding methods to learn the representation vector of each account according to its structural information and neighbor information;
[0092] A classifier module, which is used to use the representation vectors of labeled social robots and normal users to train a classifier for social robot detection.
[0093] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such a process, method, article or device.
[0094] Finally, it should be noted that the above is only a preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention and is not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are all included within the protection scope of the present invention.
Claims
1. A social robot detection method based on community walk, characterized in that It includes the following steps: Step 1: Capture the macro community structure information in the social network based on the DANMF community detection algorithm; Step 2: Design the in-community random walk rules and between-community random walk rules to capture the structure information and neighbor information of each account; Specifically including: According to the extracted communities, use the intra-community random walk rules and the inter-community random walk rules within the communities to visit each account in the social network, and obtain a representation sequence containing the structural information and neighbor information of each account; assuming that the random walk process of the given source node S starts from its own context node, so s = v0, use two parameters to control the random walk: in-out(q) and return(p), and use the second-order intra-community random walk transition probability within the community The parameter q controls the distance of community walks from a given source node s to n-hop neighbors. When q > 1, community walks tend to visit the previous v of the current node v i of the surrounding nodes of the node, and vice versa when q < 1; The return parameter p controls the probability of a community walk revisiting the node v i-1 , that is, v i = v i+1 , and a large value of the parameter p helps to reduce the probability of repeated sampling of the same node during community walks; The probability of transfer between communities i is as follows: is as follows: Among them, is a penalty term. The more edges and nodes a community has, the smaller the probability that a single node moves to the nodes within its community. In the real social network, the probability that an account interacts with the accounts within the community is greater than the probability that it interacts with the accounts outside the community. Statistical findings show that there is a phenomenon of mutual following among social robots. In communities with the same number of nodes, the number of edges in the robot community is significantly greater than that in the normal user community. Using this penalty term can reflect the characteristic that the probability that a user follows the users in a normal community is greater than the probability that the user follows the users in a robot community. The transition probability Γ is obtained from the above in-community transition probability and between-community transition probability as follows: Among them, V i represents node i, and v i+1 represents the next node of node i. E represents the set of nodes, represents the community to which node i belongs, and ψ represents the regularization constant; when the next node and the current node belong to the same community, is used as the transition probability. When the next node and the current node belong to two communities, is used as the transition probability; Step 3: Use the graph embedding method to learn the representation vector of each account according to the structure information and neighbor information of each account; Step 4: Use the representation vectors of the labeled social robots and normal users to train a classifier for social robot detection.
2. The social robot detection method based on community walk according to claim 1, wherein, The DANMF community detection algorithm integrates the encoder component and the decoder component into a unified loss function, enabling the two components to guide each other during the learning process, thereby obtaining the community member nodes.
3. The social robot detection method based on community walk according to claim 2, wherein The DANMF community detection algorithm reduces the gap between the shallow features and deep features of the original social network data through deep learning, and performs multi-layer decomposition on the mapping matrix M. After M is decomposed, it becomes M1M2…M p , where P is the number of decomposition layers; specifically expressed as: the adjacency matrix A of the social network graph is decomposed into P + 1 non-negative matrices, A≈M1M2…M p H p , where M p H p is H p-1 , that is, the community member matrix of the P - 1 layer.
4. The social robot detection method based on community walk according to claim 3, wherein, The optimized objective function of DANMF is obtained from the decoder-optimized objective function and the encoder-optimized objective function, and the mapping matrix M is updated using the multiplicative update rule. i , where \(i = 1, 2, \ldots, p\), and the community membership matrix H is updated using the multiplicative update rule. p , and the mapping matrix M is iteratively updated through the update rule. i and the community membership matrix H p , and the update stops when the optimization objective is reached, and finally the communities in the social network are extracted.
5. The social robot detection method based on community walk according to claim 1, wherein According to the extracted communities, use the in-community random walk rules and between-community random walk rules to visit each account in the social network, and obtain a representation sequence containing the structure information and neighbor information of each account.
6. The social robot detection method based on community walk according to claim 5, wherein, The representation sequences of all accounts obtained by random walks in the community are input into the Skip-gram graph embedding model for training, and the representation vectors of each account that can retain the structure information and neighbor information are learned.
7. The social robot detection method based on community walk according to claim 6, characterized in that, The representation vector is expressed by the formula: where V is the adjacency matrix of the social network graph, and the i-th row of X, X i represents the representation vector of the i-th node, and d represents the vector dimension.
8. A social robot detection device based on community walk, characterized in that For implementing the social robot detection method based on community random walks as described in any one of claims 1-7, the device includes: A community division module for capturing the macro community structure information in the social network based on the DANMF community detection algorithm; An account information capture module for designing the in-community random walk rules and between-community random walk rules to capture the structure information and neighbor information of each account; A graph embedding module for using the graph embedding method to learn the representation vector of each account according to the structure information and neighbor information of each account; A classifier module for using the representation vectors of the labeled social robots and normal users to train a classifier for social robot detection.