Detection method, system, device and medium of social robot in social network
By using the BERT model in social networks for feature encoding and building a heterogeneous hypergraph neural network, combining the graph neural network and hypergraph aggregation layer, the model-independent element learning optimization detection model is used to solve the problem of social robot detection in small sample data scenarios, and high-accuracy detection effect is achieved.
Patent Information
- Application Number
- CN202311763449.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-12-21
AI Technical Summary
The existing social robot detection scheme is difficult to effectively detect social robots in small sample data scenarios, and cannot meet the diverse social network needs.
The pre-trained model based on BERT is used to feature encoding social network entities, and a heterogeneous hypergraph neural network is constructed. Combined with the graph neural network and hypergraph aggregation layer, the detection model is optimized through model-independent meta-learning.
In the small sample data scenario, the accuracy of social robot detection is improved, and it can effectively deal with diverse social network detection tasks, avoiding the problem of low information utilization.
Smart Images

Figure CN117743597B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of online social networks, and in particular to a detection method, system, device and medium for social robots in social networks. Background Art
[0002] Online Social Networks (OSNs) is a computer-based interactive technology. It is an Internet application based on the idea and technology of Web2.0. It is a network platform for people to publish personal dynamics and obtain various information. It has a low threshold for use and gives people the right to create and select content independently. There are many types of social media, including but not limited to social networks. The concept of social media has been extended to various media such as instant messaging tools (WeChat, Instagram), news websites, e-commerce websites, and review websites. Social media on the Internet has become a widespread, large-scale, easy-to-use real-time information dissemination platform.
[0003] There are generally two types of social robot detection methods. One is based on traditional machine learning, which uses artificially extracted features such as user personal information and text content to extract indicators, and detects social robots through methods such as Bayesian networks and decision trees. The other method is based on the idea of deep learning, which captures potential features by constructing neural networks to achieve detection. At present, with the increasing size of social networks and the evolution of social robots, traditional machine learning methods can no longer distinguish between normal users and social robots. Deep learning methods can further improve the detection accuracy by analyzing multimodal content in social networks.
[0004] Social networks have diverse content. In addition to the traditional relationship of following and being followed, there are also relationships such as forwarding, liking, and commenting, as well as related social network entities such as content and topics. Since the behavioral semantics on social networks tend to be complex and diverse, many malicious users will also use complex interactive behaviors to attack. Therefore, the manifestation of social networks is a complex heterogeneous information network, and it is difficult to detect social robot-related users and content. Hypergraph is an extended form of graph theory that is used to describe more complex relationship structures. Unlike traditional graphs, hypergraphs allow edges to connect multiple nodes, not just the connection relationship between two nodes. Therefore, hypergraphs provide a more flexible and rich modeling method that can better capture multi-relationships and high-order associations.
[0005] Existing social robot detection solutions only rely on various pre-set indicator training strategy models, and strongly rely on a large number of samples to train large models, which cannot meet the occasional and diverse social network social robot detection needs. Meta-learning is a neural network optimization training method based on knowledge transfer. The meta-learning method regards the optimizable model as a meta-learner and divides the training into multiple similar detection tasks. It can realize cross-task knowledge transfer based on gradient and weight sharing. It is a deep learning model strategy optimization task that can quickly adapt to less data.
[0006] In view of the above background, it is necessary to design a new social robot detection method to solve the above problems. Summary of the invention
[0007] The purpose of the present invention is to provide a method, system, device and medium for detecting social robots in social networks, which can cope with various social robot detection tasks in small sample data scenarios and improve the accuracy of detection.
[0008] To achieve the above object, the present invention provides the following solutions:
[0009] A method for detecting a social robot in a social network, comprising:
[0010] Collecting social network behavior samples of social robots and non-social robots from social networks, and extracting entities and interaction relationships between entities from the social network behavior samples;
[0011] Use the BERT-based pre-training model to encode entity features and obtain entity feature sets;
[0012] Construct a heterogeneous social network graph to represent the interaction relationships between entities;
[0013] Constructing a heterogeneous hypergraph neural network; wherein the heterogeneous hypergraph neural network includes a plurality of stacked neural network layer structures and a linear layer; each neural network layer structure includes a graph neural network based on feature linear modulation, a hypergraph aggregation layer and a graph residual structure, wherein the graph residual structure is used to summarize the local features output by the graph neural network based on feature linear modulation and the global features output by the hypergraph aggregation layer; the linear layer is used to aggregate the features summarized by all graph residual structures and output the aggregated features;
[0014] Input the social network heterogeneous graph into a graph neural network based on feature linear modulation, input the entity feature set and the social network heterogeneous graph into a hypergraph aggregation layer, train the heterogeneous hypergraph neural network, and optimize it using a model-independent meta-learning method to obtain a social robot detection model;
[0015] Collect the social network behaviors of the users to be detected in real time, and generate the entity features of the users to be detected and the heterogeneous social network graph in the actual scenario;
[0016] The entity features of the user to be detected and the heterogeneous graph of the social network in the actual scenario are input into the social robot detection model, the aggregated features of the user to be detected are output, and finally the social robot detection result of the user to be detected is obtained through a fully connected neural network.
[0017] A detection system for social robots in a social network, comprising:
[0018] A collection module, used to collect social network behavior samples of social robots and non-social robots from social networks, and extract entities and interaction relationships between entities from the social network behavior samples;
[0019] The feature encoding module is used to encode the entity features using a BERT-based pre-trained model to obtain an entity feature set;
[0020] A heterogeneous graph construction module, used to construct a social network heterogeneous graph for representing the interaction relationship between entities;
[0021] A hypergraph neural network construction module, used to construct a heterogeneous hypergraph neural network; wherein the heterogeneous hypergraph neural network includes a plurality of stacked neural network layer structures and a linear layer; each neural network layer structure includes a graph neural network based on feature linear modulation, a hypergraph aggregation layer and a graph residual structure, wherein the graph residual structure is used to summarize the local features output by the graph neural network based on feature linear modulation and the global features output by the hypergraph aggregation layer; the linear layer is used to aggregate the features summarized by all graph residual structures and output aggregated features;
[0022] A training module, used to input the social network heterogeneous graph into a graph neural network based on feature linear modulation, input the entity feature set and the social network heterogeneous graph into a hypergraph aggregation layer, train the heterogeneous hypergraph neural network, and optimize it using a model-independent meta-learning method to obtain a social robot detection model;
[0023] A real-time collection module is used to collect the social network behavior of the user to be detected in real time and generate the entity features of the user to be detected and the social network heterogeneous graph in the actual scenario;
[0024] The detection module is used to input the entity features of the user to be detected and the heterogeneous social network graph in the actual scenario into the social robot detection model, output the aggregated features of the user to be detected, and finally obtain the social robot detection result of the user to be detected through a fully connected neural network.
[0025] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for detecting a social robot in a social network as described above is implemented.
[0026] A computer-readable storage medium stores a computer program, which, when executed, implements the method for detecting social robots in a social network as described above.
[0027] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0028] The embodiment of the present invention uses the BERT pre-training model in the preprocessing stage of text content and user attributes in social networks to extract features more effectively. At the same time, it introduces the idea of hypergraph modeling, refines the complex heterogeneous relationships in social networks into binary and multivariate relationships, and parameterizes the hypergraph structure to capture high-order social robot behavior patterns, dynamically adjust and discover potential high-order relationships in social robot detection scenarios; and by using the GNN-FiLM model (graph neural network based on feature linear modulation) to introduce learnable affine transformation parameters, adjust the weights of information transmission between different relationships, and effectively improve the ability to utilize key information; when optimizing heterogeneous hypergraph neural networks, the idea of meta-learning optimization is adopted to adaptively generate general pattern recognition strategies between different detection tasks. In the scenario of small sample data, the present invention will overcome the strong dependence of artificial intelligence on training data, and can use general strategies and external knowledge to deal with various social robot detection tasks; effectively avoid low information utilization and improve detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0030] Figure 1 A flowchart of a method for detecting a social robot in a social network provided by an embodiment of the present invention;
[0031] Figure 2 A simplified flowchart of a method for detecting a social robot in a social network provided by an embodiment of the present invention;
[0032] Figure 3 A schematic diagram of a heterogeneous social network graph provided by an embodiment of the present invention;
[0033] Figure 4A flow chart for determining a social robot detection model provided by an embodiment of the present invention;
[0034] Figure 5 A schematic diagram of module division in the process of determining a social robot detection model provided by an embodiment of the present invention;
[0035] Figure 6 A flowchart of optimization and training of a heterogeneous graph neural network provided by an embodiment of the present invention;
[0036] Figure 7 A schematic diagram of the structure of the combination of GNN-FiLM and graph residual provided in an embodiment of the present invention;
[0037] Figure 8 A meta-learning optimization flow chart provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0040] Embodiment 1
[0041] like Figure 1 As shown, an embodiment of the present invention provides a method for detecting a social robot in a social network, comprising:
[0042] Step 1: Collect social network behavior samples of social robots and non-social robots from social networks, and extract entities and interaction relationships between entities from the social network behavior samples.
[0043] The social network behavior samples include: users and their personal profiles in the social network, interaction relationships between social network users, text content in the social network, interaction relationships between social network text content, and interaction relationships between social network users and text content.
[0044] Entities include: users and text content. The interactive relationships between entities include: follow relationship, followed relationship, forwarding relationship and publishing relationship.
[0045] Step 2: Use the BERT-based pre-trained model to encode entity features and obtain the entity feature set.
[0046] The specific process is:
[0047] The user’s personal description information, avatar URL link, and text content are preprocessed using the pre-trained RoBERTa model to obtain text features.
[0048] Perform feature encoding on the user's numerical attributes to obtain numerical features.
[0049] The text features and the numerical features constitute an entity feature set.
[0050] Step 3: Construct a social network heterogeneous graph to characterize the interaction relationships between entities.
[0051] Step 4: Construct a heterogeneous hypergraph neural network; wherein the heterogeneous hypergraph neural network includes multiple stacked neural network layer structures and a linear layer; each neural network layer structure includes a graph neural network based on feature linear modulation, a hypergraph aggregation layer and a graph residual structure, and the graph residual structure is used to summarize the local features output by the graph neural network based on feature linear modulation and the global features output by the hypergraph aggregation layer; the linear layer is used to aggregate the features summarized by all graph residual structures and output aggregated features.
[0052] Step 5: Input the social network heterogeneous graph into the graph neural network based on feature linear modulation, input the entity feature set and the social network heterogeneous graph into the hypergraph aggregation layer, train the heterogeneous hypergraph neural network, and optimize it using the model-independent meta-learning method to obtain the social robot detection model.
[0053] The hypergraph aggregation layer aggregates the entity features corresponding to community hyperedges and topic hyperedges through hypergraph aggregation.
[0054] The hypergraph dependency matrix in the hypergraph aggregation layer serves as a parameter of the heterogeneous hypergraph neural network, and the hypergraph dependency matrix changes with the training of the heterogeneous hypergraph neural network.
[0055] When optimizing using model-agnostic meta-learning:
[0056] All social robots are divided into types, and the optimization problem is regarded as a binary classification task of type.
[0057] Multiple types of social robots are selected as meta-training tasks. Each meta-training task contains only one type of social robot, and the rest are non-social robots.
[0058] The meta-learner is set as a randomly initialized graph neural network based on feature linear modulation and hypergraph dependency matrix, and the base learner is a linear classifier represented by the graph.
[0059] Step 6: Collect the social network behavior of the user to be detected in real time, and generate the entity features of the user to be detected and the social network heterogeneous graph in the actual scenario.
[0060] Step 7: Input the entity features of the user to be detected and the heterogeneous graph of the social network in the actual scenario into the social robot detection model, output the aggregated features of the user to be detected, and finally obtain the social robot detection result of the user to be detected through a fully connected neural network.
[0061] Figure 2 A simplified flow chart of a method for detecting social robots in a social network according to an embodiment of the present invention. Figure 2 , the simple steps of the detection method of the present invention include:
[0062] Collect social network behavior samples of social robots and ordinary users from social networks, pre-process the sample data according to the algorithm, obtain two types of entities and four types of relationships, use the NLP pre-training model to encode the features of the two types of entities, construct heterogeneous graph data based on the entities and relationships, and use the GNN-FiLM algorithm to aggregate node features of the heterogeneous graph using the features of the two types of entities and the heterogeneous graph data after encoding. Add the parameters of the hypergraph dependency matrix to the graph neural network, optimize the parameters at the same time during training, and perform hypergraph feature aggregation according to the parameters. Finally, use the meta-learning method to optimize the entire neural network model.
[0063] Step 1: Through data provided by merchants or actively accessing social network open APIs, you can obtain user personal information, user social relationships, historical messages posted and forwarded by users, and other information from actual social networks such as Weibo and Twitter. Pre-process the user personal information, historical messages, etc.
[0064] There are two purposes of preprocessing. One is to organize and construct heterogeneous information graphs of social networks, and the other is to preprocess the content text.
[0065] Step 2: The preprocessed social network historical user relationship graph, content features, etc. are input into the proposed heterogeneous hypergraph neural network training to generate a usable prediction model;
[0066] Because the proposed model is based on inductive induction, it is necessary to follow the Sample and Aggregate operations during training. You only need to learn the Aggregate operation of node features to apply the learned knowledge to new graphs and nodes. Specifically, for real-time data in actual scenarios, a subgraph is locally sampled, and Sample and Aggregate are executed on this subgraph to obtain the model prediction results. This solution actually mainly optimizes the training of the Aggregate operation.
[0067] Step 3: For the user to be detected, use the API to collect user personal information and messages about published and forwarded content in real time. Based on the obtained messages, sample and generate a heterogeneous graph of actual scenarios consisting of user relationships and content forwarding sequences.
[0068] In step 1 and step 3, the required text messages, user personal profiles, and user friend relationships are obtained from the social network based on the open API in the social network, and the information to be used is filtered by sampling.
[0069] In step 1 and step 3, the historical forwarding sequence relationship of the message is constructed through the forwarding identifier in the historical message. Specifically, the text forwarding relationship is obtained through the " / / @username" identifier. Preprocessing includes spam filtering of the historical messages and retaining historical messages with existing content and forwarded by users.
[0070] In step 3, the collection of users and relationships is based on the "seed sampling" method. For the user to be detected, it is used as the sampling seed, and the neighborhood nodes are selected through the expansion of the friend relationship, and the subgraph is constructed. The subgraph and the relevant information mentioned in step 1 are input into the trained model to achieve the prediction of all related nodes.
[0071] Step 4: Input the social heterogeneous graph and text content features in the actual scenario into the prediction model to generate aggregated feature expressions, input the feature expressions into the fully connected neural network for classification, and output the results in a softmax manner to complete the detection of social network robots in actual scenarios.
[0072] The detailed implementation process of step 1 and step 2 is as follows: Figures 4 to 6 shown.
[0073] S1: A sample set of social robots and ordinary users, as well as their published content and social network behaviors, is collected from a real social network environment.
[0074] Get data from the foreground (or background) of the social network application:
[0075] 1) Users and their personal profiles in social networks;
[0076] 2) The interactive relationships between social network users;
[0077] 3) Text content in social networks;
[0078] 4) Interactions between text content in social networks;
[0079] 5) The interactive relationship between social network users and text content.
[0080] In this application example, two types of entities are extracted from the acquired social network data: user and post.
[0081] In this application example, the relationships between four entities are extracted from the acquired social network data as follows:
[0082] Following relationship, user user1 follows user user2;
[0083] Following relationship: user user1 is followed by user user2;
[0084] Forward relationship, tweet post1 is forwarded from tweet post2;
[0085] Publishing relationship, user user publishes a tweet post;
[0086] Each entity is stored in JSON format, and all entity attributes, whether numeric or textual, are indexed in the form of Key-Value in JSON.
[0087] In particular, the content JSON object has only one attribute, namely, the text attribute, whose value is a text content in the social network.
[0088] In particular, managing the raw data obtained from social networks in JSON format can easily change the subsequent processing method and facilitate modification to use other neural network models.
[0089] S2: Preprocess the collected sample data and perform preliminary extraction and organization of multimodal content on social networks.
[0090] S3: Use a BERT-based pre-training model to pre-train the text in the multimodal content to obtain text content features, and pre-train user personal information to obtain user initial features.
[0091] For the two types of entities extracted, users and content, feature preprocessing is performed using a pre-trained model to encode the user's numerical features and text features as well as the content's text features, and multimodal user information is used to achieve better representation effects.
[0092] Numerical features include:
[0093] 1) The number of tweets published;
[0094] 2) Number of followers of the user;
[0095] 3) Number of followers of the user;
[0096] 4) Number of characters in the username;
[0097] 5) Number of characters in the user's nickname;
[0098] 6) User account creation time;
[0099] 7) User account activation time;
[0100] 8) Account creation area code;
[0101] The user's personal description information and the URL connection of the avatar are extracted as text features and processed uniformly with the text content on the social network.
[0102] According to the paradigm of the autoencoder language model, the text content on the social platform can be regarded as a list of words arranged in order, represented as T = [T1, T2, ..., T n ], where n is the number of words in the input tweet text.
[0103] Each T i ∈T are tokenized using the vocabulary pre-prepared by RoBERTa, and each word T in the text i By mapping to a token or index in the vocabulary, the original text is converted into a sequence of words represented by the tokens in the vocabulary, which makes it easier to process and calculate in the model.
[0104] The RoBERTa model represents the input text as a series of feature vectors that encode the semantic information of each word. Assume that after being processed by the RoBERTa model, the input news text T is represented as an embedding vector sequence E = [E1, E2, ..., E n ], where E i is the feature vector of the i-th word.
[0105] Next, the feature vector sequence E is input into multiple Transformer layers in the RoBERTa model and encoded through the self-attention mechanism.
[0106] In each Transformer layer, the self-attention mechanism calculates the attention weights of each word with other words in the sequence and applies these weights to the word’s representation.
[0107] Finally, all word representations in the output sequence of the last Transformer layer are averaged to obtain the aggregated feature vector. The formula for calculating the aggregated feature vector is as follows:
[0108]
[0109] in, Represents the final text semantic features, As a weight matrix, it can also fix the dimension of the output features. i represents the feature vector of the i-th word, and b represents the learnable offset parameter.
[0110] Through this step, this example converts the original social network entities stored in Json format into a matrix storing row and column data. Each entity corresponds to a row of data in the matrix, and the processed entity attributes are stored in a file to facilitate subsequent mathematical model processing.
[0111] The pre-trained RoBERTa model is used to embed word vectors. At the same time, commonly used numerical user attributes are used to supplement and expand features.
[0112] Step S3 corresponds to Figure 5 Module 1: Pre-trained model feature extraction.
[0113] S4: Construct a heterogeneous information graph to characterize the interactive relationships on social networks, extract the relationships between users in social networks and the relationships between users and texts to construct a heterogeneous association matrix.
[0114] A social heterogeneous information graph with two types of entities and four types of relationships is constructed to effectively represent social network behaviors and relationships, such as Figure 3 shown.
[0115] S5: A GCN-based deep learning algorithm is used to train the heterogeneous association matrix and two types of initial features to build a multi-layer training model.
[0116] The graph neural network is constructed using a model based on the feature linear modulation graph neural network GNN-FiLM and a graph residual structure, and multiple graph neural network layers are stacked to capture the local neighborhood information of the social network. The GNN-FiLM model considers four different relationships respectively, and the neighbor nodes connected by different edge types undergo an affine transformation. The parameters of the affine transformation are learned using a feedforward neural network, and finally the features are summarized by cumulative aggregation.
[0117] Step 5-1-1: Discuss different relationships in heterogeneous graphs separately. For a certain relationship, build a homogeneous graph perspective and introduce graph neural network to perform neighborhood aggregation of node features, such as Figure 7 shown.
[0118] Perform an affine transformation on the input representation of each neighborhood node. Referring to the attention mechanism, the features of all neighborhood nodes must undergo affine transformation and a nonlinear activation function to obtain local aggregated features.
[0119] The parameters of the affine transformation As a learnable parameter for optimization, a simple feedforward neural network g is constructed to calculate the parameters of the affine transformation based on the output of the upper layer:
[0120]
[0121] Step 5-1-2: After calculating the parameters, use the parameters to perform feature aggregation operations on the neighborhood nodes of node v, and give the neighborhood more diverse influence representations through affine transformation:
[0122]
[0123] in and is the parameter for calculating the affine transformation of the self-feedforward neural network, W r represents the shared parameter matrix, The feature vector representing the node is introduced to represent different relationships (follow, forward, etc.), and message passing is performed for all different relationships separately. Finally, the features are summarized by cumulative aggregation.
[0124] The advantage of using affine transformation is that, by parameterizing the affine transformation, an optimizable feedforward neural network is introduced, which can perform high-order learning on node neighborhood weights.
[0125] Step 5-1-3: Use the residual method to connect the calculation results of the previous layer and the current layer to alleviate over-smoothing. Design a two-layer GNN corresponding to a residual block. The hidden layer output of the residual block can be expressed as:
[0126]
[0127] The essence of using the residual idea to optimize neural networks is to prevent problems such as gradient vanishing when the number of stacked layers of deep learning models is too deep. By introducing graph residual blocks, the number of stacked neural network layers can be appropriately increased to obtain higher-order features.
[0128] Step 5-1-4: The above steps describe a neural network layer structure. By stacking several neural network layers, the hidden layer vector output by the final layer is the heterogeneous graph embedding of social network users.
[0129] A learnable hypergraph dependency matrix is designed, and the entity features corresponding to the two hyperedges of "community" and "topic" are aggregated through hypergraph aggregation. As a parameter of the graph neural network, the hypergraph matrix can be changed with the training of the graph neural network, that is, the hypergraph structure is not fixed but parameterized. The introduction of the hypergraph structure can significantly reduce the over-smoothing phenomenon of the graph neural network. At the same time, the multivariate relationships of the hypergraph can reflect the high-order correlation relationships that are not easy to capture in social networks, greatly improving the detection performance of social robots.
[0130] Hypergraph is an extended form of graph theory, used to describe more complex relational structures. Unlike traditional graphs, hypergraphs allow edges to connect multiple nodes, not just the connection between two nodes. Therefore, hypergraphs provide a more flexible and rich modeling method that can better capture multivariate relationships and high-order associations.
[0131] Step 5-2-1: Define the multi-relationship User-Group of social network users. User-Group is a type of edge, defined as E ug , which allows more than two nodes to be connected by an edge, using an incidence matrix To represent the relationship between the User-Group edge and the User node:
[0132]
[0133] Among them, E ug Represents the set of hyperedges in a hypergraph.
[0134] Step 5-2-2: Define the multi-relationship of social network tweets Tweet-Topic, and the multi-relationship of tweets is defined as the hyperedge E tt , using an incidence matrix To represent the relationship between the Tweet-Topic hyperedge and the Twitter node:
[0135]
[0136] Among them, E tt Represents the set of hyperedges in a hypergraph.
[0137] Step 5-2-3: Define the paradigm of hypergraph aggregation:
[0138]
[0139] Similar to the paradigm of traditional graph feature aggregation, X represents the feature matrix of the node, H represents the hypergraph association matrix, and D v is the degree matrix of the node, D e is the degree matrix of the hyperedge.
[0140] Step 5-2-4: Use a hypergraph-based method to enhance the structure of the graph. Specifically, learn two sets of hyperedges in the original heterogeneous graph. In order to make more use of supervisory signals and overcome the problem of smooth transition of traditional graph neural networks, the hypergraph structure is parameterized and a good hypergraph structure is learned by using supervisory signals.
[0141] Step 5-2-5: Set up two matrices and The hypergraph dependency matrices used to represent the user and content entities are:
[0142]
[0143]
[0144] Among them, I represents the number of users in the social network structure, J represents the number of contents, and H represents the number of hyperedges. H is an adjustable hyperparameter that can be flexibly adjusted according to the scale of the social network and other conditions.
[0145] Step 5-2-6: For the feature aggregation method of the hypergraph neural network, according to the paradigm, the features of the nodes connected by the hyperedge are first aggregated to the hyperedge itself, and then the hyperedge is aggregated back to each node. Taking the user-side hypergraph as an example, the formula for hypergraph feature aggregation is as follows:
[0146]
[0147] In which, define Λ (u) ∈R H×d to represent the embedding vectors of all hyperedges, represents the embedding vector of all users in the lth layer of the hypergraph representation space, where d represents the dimension of embedding and is a hyperparameter. represents the feature vector of the user node from the previous layer. Similarly, we can get
[0148]
[0149] Step 5-2-7: The hypergraph dependency matrix is considered as a parameter matrix. This makes the hyperedges learnable. The relationship between nodes can be obtained. In order to more formally describe the parameterization of the hypergraph dependency matrix, matrix decomposition is performed:
[0150]
[0151] This is actually a relatively low-dimensional parameter matrix W (u) ∈R d×H This is no different than learning the weights in a network.
[0152] Finally, GNN (graph neural network) and hypergraph aggregation layer are used alternately to construct the overall hypergraph refinement GNN model. The graph representation learning model will be passed through the logarithmic loss function Measure the results of the calculation:
[0153]
[0154] Steps 5-2-1 to 5-2-7 correspond to Figure 5 Module 2 in: Hypergraph refinement.
[0155] The training process of step S5 corresponds to Figure 5 Module 3 in: Graph Neural Network Feature Aggregation Module.
[0156] S6: Based on the aggregated features generated by the multi-layer training model, a nonlinear activation function is used to obtain the representation of social network users, and softmax mapping is used to obtain the detection results of the corresponding social robot. Meta-learning is used to optimize the model based on the error between the detection results and the actual situation.
[0157] Optimization and training are performed through a meta-learning framework. By dividing the social robot detection tasks into multiple different tasks, the gradients during training of different tasks are shared, and knowledge from other data is transferred. In this way, the deep learning model for social robot detection can be trained with only a small amount of supervision signals.
[0158] like Figure 8 As shown, the neural network model mentioned in the above steps is trained and optimized by using a model-independent meta-learning method. In this embodiment, the idea of meta-learning can reduce the number of samples used to a certain extent and improve the accuracy of the model.
[0159] Step 6-1: All social bots are divided into subdivided types, and the optimization problem is regarded as a type detection problem (binary classification) task. That is, the social robot detection results finally obtained by the present invention are of two types: social robot and not social robot.
[0160] Step 6-2: Select a variety of Social Bots types (such as spam robots, water army robots, etc.) as meta-training tasks. Each meta-training task contains only one type of Social Bots, and the rest are ordinary users. The ones with a smaller number to be tested are used as meta-test tasks. The setting of the meta-test task is consistent with the meta-training to facilitate the transfer of knowledge in subsequent tasks.
[0161] Step 6-3: In the meta-training phase, simulate small sample scenarios to create multiple small sample scenarios, mainly for a certain type of social bots behavior, so that abnormal users and normal users can be distinguished from each other based on the similarity of their behaviors. Given all the above-mentioned initial parameters φ of the heterogeneous graph neural network and hypergraph structure refinement, design a two-layer loop optimization training. In the inner loop, the initial meta-learner φ is used to train the recognizer Get the overall error loss in all scenarios:
[0162]
[0163] in, is the error of the nth task, is the final learned parameter from the nth task, and then the overall error is used to optimize the meta-learner φ in the outer loop:
[0164]
[0165] Step 6-4: The prior knowledge in the auxiliary task is concentrated on the meta-learner φ. Then, in the meta-test phase, the samples of the target task are input, the meta-learner parameters are frozen, and only the classifier is optimized. To achieve small sample learning:
[0166]
[0167] In the actual experiment, the meta-learner is set to a randomly initialized GNN network and hypergraph dependency matrix, and the base learner is a linear classifier represented by the graph.
[0168] In each training cycle, we first sample batch data, obtain the user's embedding vector through GNN network and hypergraph learning, and then use the base learner to evaluate the performance of the meta-learner and pass the error to the meta-learner to achieve double-layer optimization. The algorithm flow chart is as follows: Figure 8 shown.
[0169] Step 6-1 to Step 6-4 correspond to Figure 5 Module 4 in: Meta-learning model optimization.
[0170] Based on hypergraph neural network and meta-learning, the present invention discloses a detection method for social robots in social networks. The present invention is used for real-time online detection of social robots, and the method includes: hypergraph modeling of social networks around the problem of heterogeneous information representation in social networks, based on multimodal elements such as social network users, content, and interactions, while introducing the concept of hypergraph, considering binary relationships and multivariate complex relationships between elements; optimizing heterogeneous graph message aggregation algorithms based on parameterized affine transformations, that is, optimizing graph neural network structures, and using the idea of meta-learning optimization to adaptively generate general pattern recognition strategies between different detection tasks. In the scenario of small sample data, the present invention will overcome the strong dependence of artificial intelligence on training data, and can use general strategies and external knowledge to deal with various social robot detection tasks; effectively avoid low information utilization and improve detection accuracy.
[0171] The present invention is a social robot detection method based on hypergraph neural network and meta-learning, which aims to improve the accuracy of the social robot detection method while reducing the dependence of the deep learning model on the number of data samples.
[0172] On the one hand, we use graph neural network-based methods to aggregate information in large-scale social networks. On the other hand, we find that introducing the idea of hypergraph modeling in social networks can improve the ability to mine high-order information. Finally, in terms of model optimization, we introduce the idea of model-independent meta-learning to avoid neural network defects such as overfitting.
[0173] The present invention models social networks as heterogeneous information networks, extracts two types of entities, namely users and text content, from social networks, and extracts four types of relationships between these two types of entities. The heterogeneous graph modeling is characterized in the form of a graph neural network, thereby using multimodal features and relationship information to jointly detect social robots. Compared with RGCN, HGT, SGBot and other methods that also use graph neural networks, the present invention also focuses on non-neighborhood node aggregation. Specifically, the present invention can achieve cross-neighborhood information transmission by introducing the structure of a hypergraph, avoiding the over-smoothing problem that occurs when using graph neural networks alone. At the same time, the introduction of hypergraphs can also capture more high-order information. The present invention also refers to the idea of HGT and introduces affine transformation parameters to assign weights to the aggregation of graph neural network messages, which plays a similar role to the attention mechanism. At the same time, the parameters of the affine transformation can also be learned through supervisory signals. The present invention takes into account that social robots are difficult to discover in social networks, so it is easy to lack training samples when using neural networks. Therefore, the present invention combines the idea of meta-learning to optimize the previous neural network to avoid the problem of overfitting of neural network training caused by small samples, and has stronger cross-task detection capabilities.
[0174] In order to evaluate the performance of the proposed method, this example selected several advanced social robot detection models and conducted experiments based on a series of social network data based on the Twitter platform compiled by Feng et al.
[0175] The data was obtained through Twitter's open API, and expert knowledge was used to assist in dividing the social robots and ordinary users in the obtained data. The dataset provides the relationship between following and being followed among users, and the relationship between forwarding and publishing tweets.
[0176] This embodiment uses the data set and follows the 4:1 division of the training set and the test set in the original benchmark test, and obtains 229,580 node data and 227,979 edge data from the data set.
[0177] The experimental results are shown in Table 1. The model of this embodiment exceeds the existing model in terms of accuracy, which verifies the effectiveness of the model.
[0178] Table 1 Experimental results
[0179]
[0180] For the small sample scenario, this paper adopts the N-way K-shot experimental setting to complete the small sample training. We randomly extract n types of (Way) samples from the meta-dataset, and randomly extract k+1 (Shot) instances from each type of sample. The meta-dataset comes from the divided Twitter dataset. Each time we divide a part of the Bots into small samples, and the others are divided into multiple different types of Bots in equal proportion. The data categories are larger than N-Way, and the number of instances in each category is larger than K-Shot.
[0181] N is set to 2, and K is set to 1 and 5 respectively, which represents the actual situation of small samples. Table 2 is the experimental results in the small sample scenario. It can be seen that when there are only 1 or two samples, the embodiment still has a high detection accuracy.
[0182] Table 2 Experimental results in small sample scenarios
[0183]
[0184] Advantages of the first embodiment of the present invention:
[0185] ① The present invention discloses a method for detecting a social robot. The BERT pre-training model is used in the preprocessing stage of text content and user attributes in social networks to extract features more effectively. At the same time, the present invention introduces the idea of hypergraph modeling, which refines the complex heterogeneous relationships in social networks into binary and multivariate relationships, and parameterizes the hypergraph structure to capture high-order social robot behavior patterns, dynamically adjust and discover potential high-order relationships in social robot detection scenarios, such as high-order relationships in lurking and gang attack scenarios.
[0186] ② The present invention transforms the heterogeneous graph convolutional neural network based on affine transformation. By introducing learnable affine transformation parameters using the GNN-FiLM model and adjusting the weights of information transmission between different relationships, the ability to utilize key information can be effectively improved. A hypergraph neural network is designed to parameterize the hypergraph dependency matrix, and aggregate information based on hyperedge transmission to avoid over-smoothing problems in graph neural networks during training.
[0187] ③The present invention designs a strategy optimization method based on model-independent meta-learning to optimize the neural network. By constructing different small sample tasks and sharing the gradients during strategy optimization, it can effectively avoid the overfitting phenomenon in the field of deep learning and can more quickly and accurately detect social robot users in social networks.
[0188] Embodiment 2
[0189] In order to execute the method corresponding to the above embodiment 1 to achieve corresponding functions and technical effects, a detection system for social robots in a social network is provided below, including:
[0190] The collection module is used to collect social network behavior samples of social robots and non-social robots from the social network, and extract entities and interaction relationships between entities from the social network behavior samples.
[0191] The feature encoding module is used to encode the features of entities using a BERT-based pre-trained model to obtain an entity feature set.
[0192] The heterogeneous graph construction module is used to construct a social network heterogeneous graph for representing the interaction relationship between entities.
[0193] A hypergraph neural network building module is used to build a heterogeneous hypergraph neural network; wherein the heterogeneous hypergraph neural network includes multiple stacked neural network layer structures and a linear layer; each neural network layer structure includes a graph neural network based on feature linear modulation, a hypergraph aggregation layer and a graph residual structure, and the graph residual structure is used to summarize the local features output by the graph neural network based on feature linear modulation and the global features output by the hypergraph aggregation layer; the linear layer is used to aggregate the features summarized by all graph residual structures and output aggregated features.
[0194] A training module is used to input the social network heterogeneous graph into a graph neural network based on feature linear modulation, input the entity feature set and the social network heterogeneous graph into a hypergraph aggregation layer, train the heterogeneous hypergraph neural network, and optimize it using a model-independent meta-learning method to obtain a social robot detection model.
[0195] The real-time collection module is used to collect the social network behavior of the user to be detected in real time, and generate the entity features of the user to be detected and the social network heterogeneous graph in the actual scenario.
[0196] The detection module is used to input the entity features of the user to be detected and the heterogeneous social network graph in the actual scenario into the social robot detection model, output the aggregated features of the user to be detected, and finally obtain the social robot detection result of the user to be detected through a fully connected neural network.
[0197] The detection system for social robots in social networks provided by the embodiments of the present invention and the detection method for social robots in social networks described in the above embodiments have similar working principles and beneficial effects, so they will not be described in detail here. For specific contents, please refer to the introduction of the above method embodiments.
[0198] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting a social robot in a social network as described above is implemented.
[0199] In addition, when the computer program in the above-mentioned memory is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
[0200] Furthermore, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed, the method for detecting a social robot in a social network as described above is implemented.
[0201] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0202] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for detecting social robots in a social network, characterized in that: include: Collecting social network behavior samples of social robots and non-social robots from social networks, and extracting entities and interaction relationships between entities from the social network behavior samples; Use the BERT-based pre-training model to encode entity features and obtain entity feature sets; Construct a heterogeneous social network graph to represent the interaction relationships between entities; Constructing a heterogeneous hypergraph neural network; wherein the heterogeneous hypergraph neural network includes a plurality of stacked neural network layer structures and a linear layer; each neural network layer structure includes a graph neural network based on feature linear modulation, a hypergraph aggregation layer and a graph residual structure, wherein the graph residual structure is used to summarize the local features output by the graph neural network based on feature linear modulation and the global features output by the hypergraph aggregation layer; the linear layer is used to aggregate the features summarized by all graph residual structures and output aggregated features; the hypergraph aggregation layer aggregates entity features corresponding to community hyperedges and topic hyperedges by means of hypergraph aggregation; the hypergraph dependency matrix in the hypergraph aggregation layer is used as a parameter of the heterogeneous hypergraph neural network, and the hypergraph dependency matrix changes with the training of the heterogeneous hypergraph neural network; The social network heterogeneous graph is input into a graph neural network based on feature linear modulation, the entity feature set and the social network heterogeneous graph are input into a hypergraph aggregation layer, the heterogeneous hypergraph neural network is trained, and a model-independent meta-learning method is used for optimization to obtain a social robot detection model; when the model-independent meta-learning method is used for optimization: all social robots are divided according to type, and the optimization problem is regarded as a binary classification task of the type, and the base learner is a linear classifier represented by the graph; multiple social robot types are selected as meta-training tasks, each meta-training task contains only one type of social robot, and the rest are non-social robots; the meta-learner is set to be a randomly initialized graph neural network based on feature linear modulation and a hypergraph dependency matrix; Collect the social network behaviors of the users to be detected in real time, and generate the entity features of the users to be detected and the heterogeneous social network graph in the actual scenario; The entity features of the user to be detected and the heterogeneous graph of the social network in the actual scenario are input into the social robot detection model, the aggregated features of the user to be detected are output, and finally the social robot detection result of the user to be detected is obtained through a fully connected neural network.
2. The method for detecting social robots in a social network according to claim 1, characterized in that: The social network behavior samples include: users in the social network and their personal profiles, interaction relationships between social network users, text content in the social network, interaction relationships between social network text content, and interaction relationships between social network users and text content; The entities include: users and text content; The interactive relationships between the entities include: a following relationship, a followed relationship, a forwarding relationship and a publishing relationship.
3. The method for detecting social robots in a social network according to claim 2, characterized in that: The BERT-based pre-training model is used to encode the entity features and obtain the entity feature set, which includes: The user's personal description information, avatar URL link and text content are preprocessed using the pre-trained RoBERTa model to obtain text features; Perform feature encoding on the user's numerical attributes to obtain numerical features; The text features and the numerical features constitute an entity feature set.
4. A detection system for social robots in social networks, characterized in that: include: A collection module, used to collect social network behavior samples of social robots and non-social robots from social networks, and extract entities and interaction relationships between entities from the social network behavior samples; The feature encoding module is used to encode the entity features using a BERT-based pre-trained model to obtain an entity feature set; A heterogeneous graph construction module, used to construct a social network heterogeneous graph for representing the interaction relationship between entities; A hypergraph neural network construction module, used to construct a heterogeneous hypergraph neural network; wherein the heterogeneous hypergraph neural network includes a plurality of stacked neural network layer structures and a linear layer; each neural network layer structure includes a graph neural network based on feature linear modulation, a hypergraph aggregation layer and a graph residual structure, wherein the graph residual structure is used to summarize the local features output by the graph neural network based on feature linear modulation and the global features output by the hypergraph aggregation layer; the linear layer is used to aggregate the features summarized by all graph residual structures and output aggregated features; the hypergraph aggregation layer aggregates entity features corresponding to community hyperedges and topic hyperedges by means of hypergraph aggregation; the hypergraph dependency matrix in the hypergraph aggregation layer is used as a parameter of the heterogeneous hypergraph neural network, and the hypergraph dependency matrix changes with the training of the heterogeneous hypergraph neural network; A training module is used to input the social network heterogeneous graph into a graph neural network based on feature linear modulation, input the entity feature set and the social network heterogeneous graph into a hypergraph aggregation layer, train the heterogeneous hypergraph neural network, and optimize it using a model-independent meta-learning method to obtain a social robot detection model; when using the model-independent meta-learning method for optimization: divide all social robots according to type, and regard the optimization problem as a binary classification task of type, and use a linear classifier represented by the graph as the base learner; select multiple social robot types as meta-training tasks, each meta-training task contains only one type of social robot, and the rest are non-social robots; set the meta-learner to a randomly initialized graph neural network and hypergraph dependency matrix based on feature linear modulation; A real-time collection module is used to collect the social network behavior of the user to be detected in real time and generate the entity features of the user to be detected and the social network heterogeneous graph in the actual scenario; The detection module is used to input the entity features of the user to be detected and the heterogeneous social network graph in the actual scenario into the social robot detection model, output the aggregated features of the user to be detected, and finally obtain the social robot detection result of the user to be detected through a fully connected neural network.
5. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, a method for detecting a social robot in a social network as claimed in any one of claims 1 to 3 is implemented.
6. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the method for detecting a social robot in a social network as described in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Session recommendation method based on social relationship and collaborative relationship
CN114036408A
Social robot detection method for Twitter user and storage medium
CN115905572A
Social robot detection system and method based on ternary graph convolutional neural network
CN116186636A
Malicious network behavior detection method and device based on meta-graph
CN116208399A
Social robot detection method and device based on multi-dimensional feature fusion and residual image neural network
CN116738331A