Social robot behavior detection method based on structure entropy and electronic equipment
By constructing harmless graphs and using them in the structural entropy robust neural network model, the problems of social robot detection feature engineering in the prior art are solved, and high accuracy and low cost social robot behavior detection are achieved.
Patent Information
- Application Number
- CN202311134484.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-04
- Publication Date
- 2025-03-11
AI Technical Summary
The existing social robot detection technology based on deep learning takes a long time in feature engineering, making it difficult to discover potential detection features, and is not suitable for the graph structure of social networks, resulting in low accuracy and high cost. The randomness and instability of social network graphs lead to graph perturbation problems, affecting the accuracy of detection results.
By constructing a harmless graph equivalent to the user's social network graph GNN, the adjacency matrix of the harmless graph is used as the input data of the robust neural network model with unsupervised structural entropy, the interference caused by the randomness of the social network graph is alleviated, and the problem of excessive smoothness of the graph neural network is solved by enhancing node characteristics.
It effectively improves the accuracy of social robot behavior detection, reduces the time cost of feature engineering, is suitable for the graph structure of social networks, and handles the randomness of social network graphs stably.
Smart Images

Figure CN119600672A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of social network detection, and in particular to a social robot behavior detection method and electronic device based on structural entropy. Background Art
[0002] "Community" has important practical application value. For example, communities in social networks may represent real social groups formed based on interests or backgrounds. Communities in citation networks may represent related papers on the same topic. Communities in the World Wide Web may be thousands of websites discussing related topics, and communities in biochemical networks or electronic circuit networks may be a certain type of functional unit. Discovering communities in these networks helps to understand and develop these networks more effectively. Mature theories related to community discovery include graph theory and pattern recognition. Social networks are a kind of community structure composed of some closely connected user nodes. Furthermore, according to the degree of connection between different user nodes in the network, we can regard the network as composed of different "clusters", in which the connections between user nodes within a "cluster" are closer, and the links between user nodes between different "clusters" are relatively sparse. This is the community structure in the network.
[0003] In recent years, research results related to social robot detection have gradually emerged. At present, social robot detection methods based on machine learning algorithms are the mainstream methods in the field of social robot detection. However, existing detection technologies based on deep learning require a high time cost for feature engineering, and it is difficult to discover some potential detection features. They are not suitable for the graph structure of social networks, and the accuracy is low and the cost is high in social robot detection. The graph structure of social networks can describe the direct or indirect relationship between social network accounts, such as following relationships and follower relationships. The influence of social users can also be measured based on social network graphs. This method is very useful for visualizing and measuring the influence rate of social networks based on the distance measurement of the influencer user node centrality. However, the graph structure of social networks is inherently random and unstable, which will cause the input graph of social robot detection technology based on graph neural networks to have graph perturbation problems, thereby affecting the accuracy of the detection results. Summary of the invention
[0004] In view of this, embodiments of the present invention provide a social robot behavior detection method and electronic device based on structural entropy to eliminate or improve one or more defects existing in the prior art.
[0005] One aspect of the present invention provides a social robot behavior detection method based on structural entropy, comprising:
[0006] Determine, according to the social network graph of the user, an adjacency matrix of the harmless graph corresponding to the social network graph; wherein the output matrix of the graph neural network with the harmless graph as input is the same as the output matrix of the graph neural network with the social network graph as input;
[0007] The adjacency matrix of the harmless graph is input into a pre-constructed unsupervised structural entropy robust neural network model so that the unsupervised structural entropy robust neural network model outputs the classification probability of the social network graph to obtain the social robot behavior detection result of the user.
[0008] In some embodiments of the present invention, each user node in the adjacency matrix of the harmless graph displays the corresponding node feature through the feature vector, before inputting the adjacency matrix of the harmless graph into a pre-built unsupervised structural entropy robust neural network model, including:
[0009] The node features of each user node in the adjacency matrix of the harmless graph are enhanced to obtain the adjacency matrix of the harmless graph after the node features are enhanced.
[0010] In some embodiments of the present invention, the step of enhancing the node features of each user node in the adjacency matrix of the harmless graph includes:
[0011] For each user node of the adjacency matrix of the harmless graph, the length of the feature vector corresponding to each user node is controlled by adding an additional vector, so as to control the fine granularity of the adjacency matrix of the harmless graph.
[0012] In some embodiments of the present invention, the node feature of each user node in the adjacency matrix of the harmless graph includes a user node ID, and correspondingly, enhancing the node feature of each user node in the adjacency matrix of the harmless graph includes:
[0013] The user node ID of each user node in the social network graph is standardized, and the user node ID of each user node in the adjacency matrix of the harmless graph is correspondingly adjusted according to the standardized user node ID.
[0014] In some embodiments of the present invention, the step of enhancing the node features of each user node in the adjacency matrix of the harmless graph includes:
[0015] Node features of each user node in the social network graph are extracted, and the node features are added to the feature vectors of the corresponding user nodes in the adjacency matrix of the harmless graph to obtain the adjacency matrix of the harmless graph after feature enhancement.
[0016] In some embodiments of the present invention, determining the adjacency matrix of the harmless graph corresponding to the social network graph according to the user's social network graph includes:
[0017] Based on the structural entropy of the social network graph, determining an indicator matrix of the social network graph;
[0018] And based on the indicator matrix of the social network graph, an adjacency matrix of the harmless graph of the social network graph is determined.
[0019] In some embodiments of the present invention, the step of inputting the adjacency matrix of the harmless graph into a pre-built robust neural network model of unsupervised structural entropy so that the robust neural network model of unsupervised structural entropy outputs the classification probability of the social network graph, comprises:
[0020] Inputting the adjacency matrix of the harmless graph into the pre-built unsupervised structural entropy robust neural network model so that the unsupervised structural entropy robust neural network model performs a social network robot detection step;
[0021] The social network robot detection step includes:
[0022] Performing a linear transformation on the adjacency matrix of the harmless graph to obtain a reduced-dimensional adjacency matrix of the harmless graph;
[0023] The adjacency matrix of the harmless graph with reduced dimension is grouped, and the node embeddings output by the node feature group of the user node in each group after passing through the corresponding GIN module are calculated respectively, and the node embeddings of the GIN module corresponding to each group are spliced and reconstructed to obtain the node embeddings of the robust neural model of the supervised structural entropy;
[0024] Determining the node embedding of each user node in the node embedding of the robust neural model of the supervised structural entropy by using the neighborhood aggregation function of class and;
[0025] Based on the node embedding of each node in the social network graph, the classification probability of the social network graph is determined by a normalized exponential function.
[0026] In some embodiments of the present invention, it further comprises:
[0027] Acquire multiple historical samples, each of which includes a social network graph of a user node and a corresponding behavior type label;
[0028] According to the social network graphs in the historical samples, an adjacency matrix of the harmless graph corresponding to each of the social network graphs is determined to form a training set;
[0029] The pre-constructed unsupervised structural entropy robust neural network model is iteratively trained based on the training set, so that the unsupervised structural entropy robust neural network model is used to output the social robot behavior detection result of the user according to the adjacency matrix of the input harmless graph.
[0030] Another aspect of the present invention provides an electronic device, including a processor and a memory, characterized in that computer instructions are stored in the memory, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the electronic device implements the social robot behavior detection method based on structural entropy as described.
[0031] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the social robot behavior detection method based on structural entropy is implemented as described.
[0032] The social robot behavior detection method based on structural entropy of the present invention uses a harmless graph equivalent to the user's social network graph GNN to determine the input data of a pre-built unsupervised structural entropy robust neural network model, which can effectively alleviate the graph perturbation problem caused by the randomness of the social network graph, thereby improving the accuracy of social robot behavior detection.
[0033] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.
[0034] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.
[0036] Figure 1 Flowchart of social robot behavior detection based on structural entropy.
[0037] Figure 2 This is the detection structure diagram of the social robot behavior detection system based on structural entropy.
[0038] Figure 3 The construction structure diagram of the harmless graph corresponding to the social network graph. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0040] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0041] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0042] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0043] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0044] In the prior art, research directions related to social robot detection mainly include machine learning-based detection methods, graph-based detection methods, and anomaly-based detection methods.
[0045] Among them, social robot detection methods based on machine learning algorithms are mainly divided into traditional machine learning and deep learning methods. Based on traditional machine learning methods, different user features are constructed; traditional machine learning algorithms such as decision trees and random forests are used to classify accounts. This detection requires extracting various features of social accounts and inputting them into machine learning models for classification. It takes a high time cost to perform feature engineering, and it is difficult to discover some potential detection features. It is also not suitable for the graph structure of social networks. With the development of deep learning technology, social robot detection methods based on deep learning have gradually become a research hotspot. For example, a deep learning model based on social behavior enhancement detects social robots. The social behavior and post content of each social account are used to model and classify them using the CNN-LSTM model. Compared with other methods, the CNN-LSTM model realizes the automatic extraction of user features and avoids the tedious feature extraction work. In addition, the deep learning method can be used to extract the semantic features contained in the tweets posted by the account, and then the features are fused with the features extracted from the account personal profile information and input into the inference layer for binary classification. Compared with several other methods based on machine learning and deep learning, this method has a greatly improved performance. However, in the process of robot evolution that is constantly updated and iterated, the accuracy of social behavior detection continues to decline.
[0046] Graph-based social robot detection methods rely on the characteristics of social graphs to distinguish robot accounts from ordinary accounts. The typical approach of this type of method is to first use graph theory related methods to model the account, and then use machine learning methods to achieve binary classification. In recent years, many social network detection methods based on graph representation learning have emerged, such as graph neural network-based methods, which extract graph encodings through recursive aggregation schemes. The aggregation scheme uses the characteristics of the user node itself and the aggregated characteristics of the user node's neighbors to learn the embedding of the user node, thereby obtaining the structural information of the graph. This method targets large-scale and real social networks, and the computational cost is very high. The performance of the graph neural network model depends on the data reliability of the social network graph as input. However, the social network graph data is random and interfering, which easily causes graph perturbation problems, affecting the accuracy of social robot behavior detection.
[0047] The anomaly-based social robot detection method exploits the assumption that legitimate social network users have no motivation to behave strangely without rewards. Therefore, under certain pre-set restrictions, users with abnormal behavior are likely to be malicious users, and when abnormal user group behavior is found, the group should be classified as a social robot group. This method requires the definition of "abnormal" in advance, so it is difficult to evaluate the rationality of the definition.
[0048] In response to the problems existing in the above-mentioned prior art, this application provides a social robot behavior detection method and electronic device based on structural entropy. The corresponding basic technical content of the application includes: structural entropy of graphs, graph representation learning, social network structure and graph neural network.
[0049] Among them, information entropy originates from the need for information measurement in communication systems. Accordingly, in order to measure the information in the graph, structural entropy is proposed and used to evaluate the complexity of the hierarchical structure of the graph. In addition, two-dimensional and three-dimensional structural entropies can measure the complexity of two-level and three-level hierarchical structures respectively. In view of this global measurement of graph information, structural entropy is used to decode the basic structure of the user's social network graph, including: for a given connected graph G, the structural entropy of G is: H(G) = min{H T (G)}, where the structural entropy H(G) determines and decodes a coding tree. By giving a code T, the uncertainty of the codewords at the vertices reached by the random walk in G is minimized, and T is used to determine the structure of G with the least uncertainty.
[0050] Graph Representation Learning (GRL) maps topological graphs to low-dimensional vector spaces, generates vectorized codes from graph data, and maintains the original graph structure while supporting graph reasoning. The topological structure of traditional social network graphs has problems such as sparsity and high computational complexity. Based on the above problems, machine learning representation methods are used to represent the potential representation of the topological structure and additional information of social network graphs. Current graph embedding algorithms are usually unsupervised algorithms, which can be roughly divided into matrix decomposition random walks and deep learning methods.
[0051] Traditional deep learning methods have been applied to extract features of Euclidean space data with great success, but the data in many practical application scenarios are generated from non-Euclidean space, and the performance of traditional deep learning methods in processing non-Euclidean space data is unsatisfactory. For example, in e-commerce, a graph-based learning system can make very accurate recommendations by leveraging the interactions between users and products, but the complexity of the graph makes existing deep learning algorithms face great challenges in processing. This is because graphs are irregular, each graph has an unordered node of variable size, and each node in the graph has a different number of adjacent nodes, resulting in some important operations (such as convolution) that are easy to calculate on images, but are no longer suitable for direct use on graphs. In addition, a core assumption of existing deep learning algorithms is that data samples are independent of each other. However, this is not the case for graphs. Each data sample (node) in the graph will have edges related to other real data samples (nodes) in the graph, and this information can be used to capture the interdependencies between instances. GNN is a connection model that obtains dependencies in the graph by passing information between nodes in the network. GNN updates the node state from neighbors at any depth of the node, and this state can represent state information. Graph neural networks can be divided into five categories: Graph Convolution Networks (GCN), Graph Attention Networks, Graph Autoencoders, Graph Generative Networks, and Graph Spatial-temporal Networks.
[0052] Based on the technical problems existing in the above-mentioned prior art and the corresponding prior art, the present application proposes a social robot behavior detection method and electronic device based on structural entropy. The method constructs a harmless graph equivalent to the user's social network graph GNN, and reduces the interference caused by the randomness of the social network graph through the construction of the harmless graph. Then, by enhancing the node features of each node in the social network graph, the problem of over-smoothing of the social network graph of each user in the graph neural network is solved, thereby effectively improving the scope of application of the classification task. The adjacency matrix of the harmless graph is used as the input data of the robust graph neural network based on unsupervised structural entropy, so that the model can learn the embedding and the harmless graph at the same time, thereby more accurately realizing the behavior detection of the social robot.
[0053] The above-mentioned social robot behavior detection method based on structural entropy is as follows: Figure 1 As shown, steps S110-S130 are included:
[0054] Step S110, determining the adjacency matrix of the harmless graph corresponding to the social network graph according to the user's social network graph; wherein the output matrix of the graph neural network with the harmless graph as input is the same as the output matrix of the graph neural network with the social network graph as input.
[0055] The user's social network graph represents the connection relationship between the current user and other users in the same social network. When a user in a social network interacts with other users in the same social network, such as following, forwarding, and commenting, it means that a connection relationship has appeared between different users. The user's social network graph can be represented as G = (V, ε, X), where V = {v1, v2, ..., v n} represents the set of n user nodes in the social network graph; ε is the set of edges in the social network graph, which represents the connectivity between every two user nodes in the social network graph; X = {x1, x2, …, x n} is the original feature matrix of the social network graph, which represents the set of feature vectors of n user nodes in the social network graph, x i ={M i,1 (R), M i,2 (R),…,M i,d (R)} represents the set of d node features of the i-th user node in the social network graph, M i,j (R) represents the jth node feature of the i-th user node in the social network graph, R represents the initial feature, where i represents the serial number of the user node in the social network graph, and j represents the serial number of the node feature corresponding to each user node. The corresponding adjacency matrix of the social network graph of the above user is: A = (V, ε), where A∈M n {0, 1), if {v i , v j}∈ε, then A ij =1.
[0056] The function for learning a graph neural network (GNN) on a social network graph is expressed as:
[0057] GNN(A,X{W (1)})=H (l)
[0058] Among them, H (l) H represents the matrix learned by the input social network graph through the lth information aggregation layer of the graph neural network, (0) =X (0) , represents the original feature matrix of the user’s social network graph as the input of the first layer of the graph neural network; l∈(0, t] indicates the information aggregation layer in the graph neural network; and H (l) =σ(agg(AH(l-1) W (1) ))For all l∈(0,t], And d (0) =d. σ(·) is the activation function; Agg(·) is the aggregation; W (l) represents a learnable parameter.
[0059] Through the function representation of the graph neural network learning mentioned above, it can be known that in the graph neural network model, the feature vector of the user node can not only be used to calculate the node features of the user node, but also can be recursively accumulated to the node features of other adjacent user nodes. Therefore, the input data set of the graph neural network model composed of the social network graph is essentially random and unstable, and can also reflect some hidden but stable potential intrinsic connectivity distribution between each user node in the social network. In a social network, each user node in the social network can be naturally separated into multiple partitioned data sets according to the intrinsic connectivity of each user node. User nodes in the same partition are more likely to be connected to each other than user nodes in different partitions; based on this, the intrinsic connectivity graph of the social network graph is defined, and the intrinsic connectivity graph between user nodes in the Ith partition is set as: G I =(V,ε I ), where for any two user nodes v i and v j , there exists an edge (v i , v j )∈ε I , then the user node v i and v j belong to the same partition. For a data set containing c partitions, the condition Rank(A I )=c,where A I It's G I The adjacency matrix, Rank(A I ) represents G I The adjacency matrix A I rank.
[0060] In response to the random interference problem existing in the above social network graph, this application proposes to generate a new graph based on the real social network graph to reduce the interference of the randomness of the social network graph on the learning of the graph neural network. We observe that the graph neural network can learn the same embedding from different input graphs. If the two graphs are input into the graph neural network as input data, and the matrices output by the graph neural network are the same, then the two graphs GNN as input data of the graph neural network are considered to be equivalent. Correspondingly, if the social network graphs G0 = (V0, ε0, X0) and G1 = (V1, ε1, X1) are input into the graph neural network, the output of the graph neural network satisfies:
[0061]
[0062] It is considered that the social network graph G0 and the social network graph G1, which are the input data of the graph neural network, are equivalent to each other. A0 and A1 are the adjacency matrices of G0 and G1 respectively. and are the weights of G0 and G1 in the first information aggregation layer respectively.
[0063] In this application, the above basic conditions of GNN equivalence are used to construct a harmless graph of the user's social network graph, and the harmless graph of the social network graph is used to replace the social network graph and input into the corresponding graph neural network model to reduce the interference problem caused by the randomness of the social network graph. Correspondingly, let the harmless graph of the social network graph G be G', then the necessary conditions of the harmless graph of the social network graph include:
[0064] The social network graph G and the harmless graph G′ are equivalent in GNN, and Rank(A′)≥Rank(A)
[0065] Among them, A′ is the adjacency matrix of the harmless graph G′ of the social network graph G, and A is the adjacency matrix of the social network graph G.
[0066] In the above step S110, the process of constructing the harmless graph of the user's social network graph is as follows: Figure 3 As shown, it includes: determining an indicator matrix of the social network graph based on the structural entropy of the social network graph; and determining a harmless graph of the social network graph based on the indicator matrix of the social network graph.
[0067] Determining the indicator matrix of the social network graph based on the structural entropy of the social network graph includes inputting the social network graph into a graph neural network model so that the graph neural network model outputs the indicator matrix of the social network graph based on the structural entropy of the social network graph.
[0068] Among them, the structural entropy (NPSI) of the social network graph G is:
[0069]
[0070]
[0071] Where P(G) = {C0, C1, ..., C r-1}, represents the partitioning scheme of the social network graph, that is, the social network graph G is divided into C0, C1, ..., C r-1 There are r partitions in total; vol k Represents C k The number of edges in the partition that connect at least one node is equal to the kth value of the column sum in (AY) equal to vol k, by {1} r×n Calculate the kth diagonal element in AY; g k Represents C k Variables in a partition that are connected to only one node; vol k -g k Represents C k The number of edges connecting only two nodes in a partition is equal to (Y T The kth diagonal element in AY); Y∈{0,1} n×r represents the indicator matrix between each node and each partition in the above partition scheme P(G), for example, Y i,k represents the index between the i-th node and the k-th partition, n represents the number of user nodes in the social network graph, r represents the number of partitions in the social network graph, if v i ∈C k , then Y i,k =1, otherwise Y i,k =0; if (Y T Y)kk>0, at the same time If k≠m, then (Y T Y)km=0. trace(·) represents the trace of the matrix.
[0072] The method of determining the harmless graph of the social network graph based on the indicator matrix of the social network graph comprises: minimizing the structural entropy of the harmless graph by utilizing the learnable adjacency matrix of the harmless graph of the social network graph based on the determined indicator matrix of the social network graph, so as to learn and obtain the harmless graph of the social network graph.
[0073] Based on the necessary conditions of the harmless graph of the social network graph, it can be known that after the harmless graph of the social network graph is input into the graph neural network model, the indicator matrix of the harmless graph output by the graph neural network model is the same as the indicator matrix of the social network graph. Then, the adjacency matrix of the harmless graph G′ of the social network graph G is A′:
[0074] A′=argmin A ′(NPSI(A′,Y))
[0075] By minimizing the structural entropy of the harmless graph G′, the adjacency matrix of the harmless graph G′ is learned to be A′.
[0076] In one or more embodiments of the present application, an objective function is constructed based on the structural entropy of the harmless graph G′, and the adjacency matrix A′ that satisfies the necessary condition of the harmless graph Rank(A′)≥Rank(A) is learned by minimizing the objective function. The objective function is:
[0077] l N=NPSI(A′,Y)+βDBI(X,Y)
[0078] Among them, A′ i,j ≥0, A′=A′ T , Y∈{0,1} n×r , l N The loss function β representing the structural entropy and similarity of the harmless graph is a hyperparameter; DBI (X, Y) is the similarity of node features in the same partition analyzed using the Davies-Bouldin (DBI) index based on the fixed indicator matrix Y, and the similarity of node features in the same partition is:
[0079]
[0080] Among them, DI k =max m≠k (R km ) represents the maximum similarity value between the kth partition and other partitions. R km represents the similarity between the kth partition and the mth partition, where k and m represent the ordinal numbers of the partitions. represents the dispersion of user nodes in the kth partition, C k represents the number of user nodes in the kth partition, X i,k represents the node features of the i-th user node in the k-th partition, represents the mean distance between each user node in the kth partition and the center of the kth partition, M km Represents the distance between each user node in the kth partition and the center point of the mth partition.
[0081] By minimizing the objective function l N , and obtain the adjacency matrix A′ of the harmless graph of the social network graph. And based on the determination of the adjacency matrix A′ of the harmless graph, the harmless graph is divided into partitions with high internal connectivity and sparse internal connectivity:
[0082] C k = {v i |Y i,k ≠0}
[0083] Where Y = argmin Y (NPSI(A′,Y)),Y∈{0,1} n×r ,
[0084] In this embodiment, the objective function l is minimized. N , obtain the optimized adjacency matrix A′ of the harmless graph and the indicator matrix Y of the partition of the harmless graph for the user social network graph.
[0085] Step S120, enhancing the node features of each user node in the adjacency matrix of the harmless graph to obtain the adjacency matrix of the harmless graph after node feature enhancement.
[0086] In the graph data classified by the graph neural network model, if the social network graphs corresponding to different user nodes are the same, the probability that each user node has the same label is very high, and the graph neural network may not be able to distinguish these user node types; if the social network graphs corresponding to different user nodes are different, the probability that each user node has the same label is very low, and a higher number of layers is required to classify the social network graph, and a higher number of layers is likely to cause performance degradation of the graph neural network model. For the graph data classified by the graph neural network model, the lengths of the node feature vectors corresponding to the user nodes in the social network graphs of the above two cases are quite different, which will affect the learning performance of the graph neural network model.
[0087] The present application solves the above problem by enhancing the node features of each user node in the adjacency matrix of the harmless graph, including: randomly adding feature vectors of user nodes, standardizing node IDs, and increasing position features of user nodes.
[0088] The randomly adding feature vectors of user nodes includes: for each user node of the adjacency matrix of the harmless graph, controlling the length of the feature vector corresponding to each user node by adding an additional vector to control the fine granularity of the adjacency matrix of the harmless graph.
[0089] The standardized node ID includes: standardizing the user node ID of each user node in the social network graph, and adjusting the user node ID of each user node in the adjacency matrix of the harmless graph according to the standardized user node ID. Specifically, it includes: encoding the user node IID through a hash function, converting each user node ID into a unique standardized node ID of a fixed length, and using the NAUTY algorithm to calculate the regular sequence, using the single-hot encoding of the standardized node ID as the initial node feature, and replacing the corresponding user node ID in the adjacency matrix of the harmless graph with the standardized node ID, so as to facilitate the rapid identification of different user nodes in practice, and solve the problem of difficulty in distinguishing graph neural networks caused by graph isomorphism.
[0090] Adding position features of user nodes includes: extracting node features of each user node in the social network graph, constructing a similarity matrix of each user node in the social network graph through the node features of each user node, and using a 1∞ embedding method to embed the nodes in the similarity matrix into an adjacency matrix of a harmless graph in a 1∞ space, thereby obtaining the adjacency matrix of the harmless graph after feature enhancement.
[0091] In one or more embodiments of the present application, adding the location features of the user nodes specifically includes: extracting the node positions of each user node as node features, constructing a similarity matrix between each user node by calculating the distance or similarity between each node feature, and using the 1∞ embedding method to embed the node positions of each user node in the social network graph into a low-dimensional vector space to obtain a vector representation of the location features of each user node. This is to embed the location features of each user node into the node features of the corresponding user node in the social network graph, and obtain an adjacency matrix of the harmless graph after the location features are embedded.
[0092] Among them, based on the gradient or iterative optimization algorithm, the vector representation of the position feature of each user node is optimized, and the vector representation of the position feature of each user node in the embedding result is determined by minimizing the maximum difference of 1∞ distance between the vector representations of the position features of each user node. Specifically, the force-directed technology is used to obtain the graphical layout of the minimized stress (STRESS) function:
[0093]
[0094] Among them, p(v i ) is the user node v i Coordinate position in Euclidean vector space; d ij For user node v i To user node v j The shortest path distance; w ij is a weighting factor used to balance the impact of certain user node pairs,
[0095] The local Newton-Raphson Method (NR method) is used to optimize the stress function. The minimum value of the stress function is solved iteratively. A node is selected in each step, and the standard NR method is used to find the local minimum value of the stress function. The coordinate position of each user node in the 1∞ vector space is obtained by optimizing the stress function, and the vector representation of the position characteristics of each user node is obtained.
[0096] Step S130, inputting the adjacency matrix of the harmless graph into a pre-constructed unsupervised structural entropy robust neural network model, so that the unsupervised structural entropy robust neural network model outputs the classification probability of the social network graph to obtain the social robot behavior detection result of the user.
[0097] The step of inputting the adjacency matrix of the harmless graph into a pre-built unsupervised structural entropy robust neural network model so that the unsupervised structural entropy robust neural network model outputs the classification probability of the social network graph comprises: inputting the adjacency matrix of the harmless graph into the pre-built unsupervised structural entropy robust neural network model so that the unsupervised structural entropy robust neural network model performs a social network robot detection step.
[0098] The social network robot detection step includes:
[0099] Step S131, performing a linear transformation on the input matrix of the unsupervised structural entropy robust neural model (XG-BoT) to reduce the dimension of the input matrix.
[0100] In one or more embodiments of the present application, the adjacency matrix A′∈Rn×n of the harmless graph of the social network graph is input into the XG-BoT model as an input matrix, and the adjacency matrix of the harmless graph is converted into a feature vector of each node of a specific dimension through a linear transformation to obtain the adjacency matrix of the harmless graph after dimensionality reduction. In one embodiment, the feature vectors of each user node are set to be 64-dimensional vectors.
[0101] Step S132, grouping each reduced-dimensional input matrix on the hidden layer channel dimension, respectively calculating the node embeddings output by the node feature matrix of the user nodes in each group after passing through the corresponding GIN module, and concatenating and reconstructing the node embeddings of the GIN module corresponding to each group to obtain the node embeddings of the robust neural model of the unsupervised structural entropy.
[0102] In the above step S132, the grouping of each reduced-dimensional input matrix is expressed as:
[0103]
[0104] Among them, X′0 represents the grouping of node features for message propagation, X is the input matrix of the robust neural model of unsupervised structural entropy; E represents the trainable grouping number parameter, and e represents the GIN grouping number.
[0105] The calculation of the node embedding outputted by the corresponding GIN module after the node features in each group are passed through the corresponding GIN module comprises: using each of the GIN modules to embed the node features X of the corresponding group eNode embedding calculation is performed, and a reversible residual connection mechanism is adopted to minimize over-smoothing and memory consumption problems; the GIN module calculates the node embedding expression as:
[0106] X′ e =f we (X′ e-1 , g)+X e , e∈{1,...,E}
[0107] Among them, X′ e represents the node embedding output by the node features in the e-th GIN group after passing through the corresponding GIN module, that is, the node embedding matrix generated by the e-th layer in the GIN module; f we (X′ e-1 , g) represents the calculation function of the GIN module, X′ e-1 It represents the node embedding output by the corresponding GIN module after the node features in the e-1th GIN group pass through, that is, the node embedding matrix generated by the e-1th layer in the GIN module.
[0108] Each reversible GIN module receives the node feature X of its corresponding group e Then the corresponding intermediate node y will be generated e :
[0109] y e =x e +G e (x f )
[0110] Among them, G e (x f ) represents the GIN heterogeneous neural network, G e (x f ) represents the node embedding matrix output by the e-th GIN group when the node features of the user node in the received f-th GIN group are used as the input matrix of the GIN group.
[0111] The node embedding of the GIN module corresponding to each group is concatenated and reconstructed, which is specifically expressed as follows:
[0112] X′=X′ e ||X′ f
[0113] where X′ represents the node embedding of the robust neural model that supervises structural entropy.
[0114] In an embodiment corresponding to the above embodiment, the adjacency matrix of the harmless graph after dimensionality reduction is divided into two groups in this application, and each reversible GIN module receives the feature matrices (x1, x2) of two grouped user nodes and generates two intermediate node representations (y1, y2). Then the residual function of GIN blocks G1 and G2 is:
[0115] y1=x1+G1(x2)
[0116] y2=x2+G2(x1)
[0117] Correspondingly, the node embeddings of the GIN module corresponding to the feature matrix of the user node of each group are concatenated to reconstruct the node embedding, which is specifically expressed as:
[0118] A′′=A′′1||A′′2
[0119] Wherein, A′′ represents the reconstructed adjacency matrix of the harmless graph, A′′1 represents the adjacency matrix of the harmless graph in the first group, and A′′2 represents the adjacency matrix of the harmless graph in the second group.
[0120] Step S133, respectively determining the node embedding of each user node in the node embedding of the robust neural model of the supervised structural entropy by the neighborhood aggregation function of the class and. Specifically comprising: feeding the node embedding of the robust neural model of the supervised structural entropy to a fully connected (MLP) layer, so that the MLP layer outputs the node embedding of each user node by the neighborhood aggregation function of the class and in the graph encoder module.
[0121] The MLP layer uses a graph isomorphism network (GIN) encoder as a graph encoder module, and multiple layers of GIN encoders can be stacked in the MLP layer, wherein the GIN encoder in the MLP layer calculates the node embedding of each user node through a neighborhood aggregation function of class sum, thereby capturing structural homogeneity and neighborhood homogeneity. Then the node embedding of each user node output by the GIN encoder in the MLP layer is:
[0122]
[0123] in, For user node v j The node embedding output by the k-th GIN encoder in the MLP layer, ∈ represents the parameter, and N(v) is the set of user nodes in the input matrix. MLP is a multi-layer perceptron. (k) is a fixed scalar or trainable parameter. We can stack L layers of GIN encoders in the MLP layer to get the final user node v j Node embedding Classes and aggregators in the GIN encoder, which are crucial for representing botnet behavior patterns.
[0124] In one embodiment of the present application, two MLP layers are used, and the node embedding of each user node is performed using the ReLU activation function and batch normalization in each MLP layer.
[0125] Step S134, based on the node embedding of each node in the social network graph, the classification probability of the social network graph is determined by a normalized exponential function. Specifically, the node embedding of each node output by the MLP layer is fed to the Softmax (normalized exponential function) layer, so that the Softmax (normalized exponential function) layer outputs the classification probability of the input matrix of the corresponding unsupervised structural entropy robust neural model.
[0126] Based on the node embedding, the learnable parameter matrix W Y ∈R d(2)×c The softmax layer of the group indicator matrix Y is obtained:
[0127] Y = softmax(HW Y )
[0128] in, Represents the node embedding corresponding to each user node in the input matrix of the robust neural model of the supervised structural entropy; Y∈(0,1), represents the classification probability of the input matrix of the robust neural model of the supervised structural entropy.
[0129] In an embodiment corresponding to the above embodiment, the present application determines the probability that the user behavior corresponding to the social network graph belongs to the botnet behavior pattern through the softmax layer, and determines whether the user behavior corresponding to the current social network graph belongs to the botnet behavior pattern through the classification probability output by the softmax layer, thereby realizing the user's social robot behavior detection.
[0130] The robust neural network model of unsupervised structural entropy in this application is based on grouped reversible residual connections, improves classification performance by enhancing node representation, and utilizes graph isomorphism networks (GINs) to effectively deal with the model performance degradation problem caused by a higher number of layers (i.e., the vanishing gradient problem) for effective social network robot detection.
[0131] The above-mentioned social robot behavior detection method based on structural entropy also includes the training steps of the robust neural network model of unsupervised structural entropy:
[0132] Acquire multiple historical samples, each of which contains a social network graph of a user node and its corresponding behavior type label; determine the adjacency matrix of a harmless graph corresponding to each social network graph based on the social network graph in each of the historical samples to form a training set; iteratively train a pre-constructed unsupervised structural entropy robust neural network model based on the training set, so that the unsupervised structural entropy robust neural network model is used to output the social robot behavior detection result of the user node according to the adjacency matrix of the input harmless graph.
[0133] The behavior type label includes botnet behavior and / or normal network behavior. The social robot behavior detection result of the user node output by the unsupervised structural entropy robust neural network model is the probability that the social robot behavior of the user node belongs to botnet behavior and / or normal network behavior.
[0134] The iterative training of the pre-built unsupervised structural entropy robust neural network model based on the training set includes: minimizing the loss function L of the unsupervised structural entropy robust neural network model. S And the loss function L of structural entropy N , to achieve iterative training of robust neural network models with unsupervised structural entropy.
[0135] L=L N +αL s
[0136] in, The loss function of the robust neural network model representing the unsupervised structural entropy, The node embedding H output by the robust neural network model of unsupervised structural entropy is the matrix function learned by the sigmoid function, A represents the adjacency matrix learned by the neural network learning model of the social network graph; α is a hyperparameter, and the robust neural network model of unsupervised structural entropy is trained by minimizing the loss function L.
[0137] The social robot behavior detection method based on structural entropy described in the present application can effectively reduce the interference caused by the randomness of the user's social network graph by constructing a harmless graph corresponding to the user's social network graph equivalent to the user's social network graph GNN, and using the adjacency matrix of the harmless graph instead of the adjacency matrix of the social network icon as the input model of the unsupervised structural entropy robust neural network model. By increasing the node features of each user node in the adjacency matrix of the harmless graph, the problem of being unable to achieve individual classification tasks due to over-smoothing of the graph neural network can be effectively solved. The inherent connectivity between each user node in the user's social network graph is analyzed by the unsupervised structural entropy robust neural network model, and the grouped reversible residual connection with the graph isomorphic network is used to learn the expressive nodes from the social network graph, thereby realizing robot nodes in large-scale social networks.
[0138] Corresponding to the above method, the present invention also provides a social robot behavior detection system based on structural entropy, which performs social robot behavior detection structure diagram as shown in Figure 2 As shown, by executing the processing flow of step S110 in the above-mentioned social robot behavior detection method based on structural entropy, based on the user's social network graph, by analyzing the inherent connectivity of the social network graph, the adjacency matrix of the harmless graph corresponding to the social network graph is determined by structural entropy loss and GNN equivalence. By executing the processing flow of step S120 in the above-mentioned social robot behavior detection method based on structural entropy, the node features of each user node are added to the adjacency matrix of the harmless graph. By executing the processing flow of step S130 in the above-mentioned social robot behavior detection method based on structural entropy, the adjacency matrix of the harmless graph is input into the unsupervised structural entropy robust neural network model, so that the unsupervised structural entropy robust neural network model outputs the classification probability of the user's social network graph, and the user's social robot behavior detection result is obtained.
[0139] Corresponding to the above method, the present invention also provides an electronic device, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the electronic device implements the steps of the social robot behavior detection method based on structural entropy as described above.
[0140] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned social robot behavior detection method based on structural entropy are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0141] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0142] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0143] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or replace features of other embodiments.
[0144] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A social robot behavior detection method based on structural entropy, characterized in that: include: Determine, according to the social network graph of the user, an adjacency matrix of the harmless graph corresponding to the social network graph; wherein the output matrix of the graph neural network with the harmless graph as input is the same as the output matrix of the graph neural network with the social network graph as input; The adjacency matrix of the harmless graph is input into a pre-constructed unsupervised structural entropy robust neural network model so that the unsupervised structural entropy robust neural network model outputs the classification probability of the social network graph to obtain the social robot behavior detection result of the user.
2. The social robot behavior detection method based on structural entropy according to claim 1 is characterized in that: The node features corresponding to each user node in the adjacency matrix of the harmless graph are displayed by a feature vector, before the adjacency matrix of the harmless graph is input into a pre-built robust neural network model of unsupervised structural entropy, including: The node features of each user node in the adjacency matrix of the harmless graph are enhanced to obtain the adjacency matrix of the harmless graph after the node features are enhanced.
3. The social robot behavior detection method based on structural entropy according to claim 2 is characterized in that: The step of enhancing the node features of each user node in the adjacency matrix of the harmless graph comprises: For each user node of the adjacency matrix of the harmless graph, the length of the feature vector corresponding to each user node is controlled by adding an additional vector, so as to control the fine granularity of the adjacency matrix of the harmless graph.
4. The social robot behavior detection method based on structural entropy according to claim 2 is characterized in that: The node feature of each user node in the adjacency matrix of the harmless graph includes a user node ID. Correspondingly, the node feature of each user node in the adjacency matrix of the harmless graph is enhanced, including: The user node ID of each user node in the social network graph is standardized, and the user node ID of each user node in the adjacency matrix of the harmless graph is correspondingly adjusted according to the standardized user node ID.
5. The social robot behavior detection method based on structural entropy according to claim 2 is characterized in that: The step of enhancing the node features of each user node in the adjacency matrix of the harmless graph comprises: Node features of each user node in the social network graph are extracted, and the node features are added to the feature vectors of the corresponding user nodes in the adjacency matrix of the harmless graph to obtain the adjacency matrix of the harmless graph after feature enhancement.
6. The social robot behavior detection method based on structural entropy according to claim 1 is characterized in that: The step of determining the adjacency matrix of the harmless graph corresponding to the social network graph according to the user includes: Determining an indicator matrix of the social network graph based on the structural entropy of the social network graph; And based on the indicator matrix of the social network graph, an adjacency matrix of the harmless graph of the social network graph is determined.
7. The social robot behavior detection method based on structural entropy according to claim 1 is characterized in that: The step of inputting the adjacency matrix of the harmless graph into a pre-built robust neural network model of unsupervised structural entropy, so that the robust neural network model of unsupervised structural entropy outputs the classification probability of the social network graph, comprises: Inputting the adjacency matrix of the harmless graph into the pre-built unsupervised structural entropy robust neural network model so that the unsupervised structural entropy robust neural network model performs a social network robot detection step; The social network robot detection step includes: Performing a linear transformation on the adjacency matrix of the harmless graph to obtain a reduced-dimensional adjacency matrix of the harmless graph; The adjacency matrix of the harmless graph with reduced dimension is grouped, and the node embeddings output by the node feature group of the user node in each group after passing through the corresponding GIN module are calculated respectively, and the node embeddings of the GIN module corresponding to each group are spliced and reconstructed to obtain the node embeddings of the robust neural model of the supervised structural entropy; Determining the node embedding of each user node in the node embedding of the robust neural model of the supervised structural entropy by using the neighborhood aggregation function of class and respectively; Based on the node embedding of each node in the social network graph, the classification probability of the social network graph is determined by a normalized exponential function.
8. The social robot behavior detection method based on structural entropy according to claim 1 is characterized in that: Also includes: Acquire multiple historical samples, each of which includes a social network graph of a user node and a corresponding behavior type label; According to the social network graphs in the historical samples, an adjacency matrix of the harmless graph corresponding to each of the social network graphs is determined to form a training set; The pre-constructed unsupervised structural entropy robust neural network model is iteratively trained based on the training set, so that the unsupervised structural entropy robust neural network model is used to output the social robot behavior detection result of the user according to the adjacency matrix of the input harmless graph.
9. An electronic device comprising a processor and a memory, characterized in that: The memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the electronic device implements the social robot behavior detection method based on structural entropy as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the social robot behavior detection method based on structural entropy as described in any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Social robot identification method based on multi-scale entropy features, terminal and medium
CN121834537A
Social robot recognition method based on multi-scale entropy feature, terminal and medium
CN121834537B