A robot detection method and system based on sample balancing strategy and heterogeneous graph

Through the sample balancing strategy and heterogeneous graph method, the problems of sample imbalance and insufficient feature utilization in social robot detection in social networks are solved, and high-precision and robust social robot detection is achieved.

CN120470378BActive Publication Date: 2025-09-23ARTIFICIAL INTELLIGENCE INNOVATION RES INST OF ZHEJIANG UNIV OF TECH BINJIANG DISTRICT HANGZHOU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510942660.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-09-23
Estimated Expiration
2045-07-09

AI Technical Summary

Technical Problem

Existing social robot detection methods perform poorly when facing new social robots, and the imbalanced sample distribution problem makes it difficult for the model to fully learn the characteristics of minority samples, resulting in insufficient detection accuracy and robustness.

Method used

A method based on sample balancing strategy and heterogeneous graph is adopted. The sample distribution is balanced through oversampling and undersampling techniques. The user reply graph and attention graph are constructed and fused into a heterogeneous graph. The graph neural network is used to extract features and the semantic attention mechanism is combined for classification and prediction.

Benefits of technology

The recognition accuracy and robustness of social robot detection have been significantly improved, noise interference has been reduced, the generalization performance of new robot disguised behaviors has been improved, and the reliability of detection results in different application scenarios has been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120470378B_ABST
    Figure CN120470378B_ABST
Patent Text Reader

Abstract

The present invention discloses a robot detection method and system based on a sample balancing strategy and heterogeneous graphs, which belongs to the field of robot detection technology. The present invention effectively alleviates the problem of unbalanced data distribution in robot detection through a sample balancing strategy, and combines the multi-relationship modeling capabilities of heterogeneous graphs to fully explore the attention behaviors and semantic similarities between users, significantly improving the recognition accuracy of social robots. Graph neural networks are used to hierarchically aggregate feature information in different relationship graphs, and multimodal data is dynamically fused through a semantic attention mechanism, thereby enhancing the model's ability to parse complex social network relationships. At the same time, the coordinated application of oversampling and undersampling reduces noise interference, further improving the system's generalization performance for new robot disguised behaviors, and ensuring the robustness and reliability of detection results in different application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of robot detection, and in particular relates to a robot detection method and system based on a sample balancing strategy and a heterogeneous graph. Background Art

[0002] The emergence of social bots stems from the promising goal of automating certain functions and improving user experience. However, because they can perform actions quickly and at scale, they can easily amplify negative impacts. For example, during the dissemination of hot news, social bots can spread a large amount of unverified false information. Therefore, accurately and effectively detecting social bots has become a critical challenge that needs to be addressed.

[0003] Existing methods for social bot detection can be broadly categorized into three main groups: feature-based, text-based, and graph-based. Each of these approaches possesses unique advantages, but also certain limitations. Feature-based methods, for example, played an important role in the early stages of social bot detection. However, with the continuous development and evolution of social bot technology, these methods have gradually become limited. Modern social bots are able to evade feature-based detection methods by carefully creating deceptive accounts with manipulated metadata, or even by misrepresenting tweets from real users. This camouflage significantly reduces the effectiveness of feature-based methods when detecting new types of social bots, making them ineffective in addressing complex and ever-changing detection requirements.

[0004] At the same time, sample imbalance is a critical issue in social bot detection, posing a significant challenge to existing methods. In many existing datasets, there's often a significant disparity between the number of bot samples and real user samples. This disparity makes it difficult for models to fully learn the characteristics of the minority class (bot samples) during training. Therefore, a method to address these challenges is urgently needed. Summary of the Invention

[0005] In order to solve the above technical problems, the present invention proposes a robot detection method and system based on sample balancing strategy and heterogeneous graph to solve the problems existing in the above-mentioned prior art.

[0006] In a first aspect, to achieve the above-mentioned objectives, the present invention provides a robot detection method based on a sample balancing strategy and a heterogeneous graph, comprising the following steps:

[0007] Perform word embedding processing on the user's text information to generate user node representation;

[0008] By combining oversampling and undersampling techniques, we perform sample balancing on user reply relationship data to construct a reply graph, and then build an attention graph based on user attention behavior.

[0009] Constructing a similarity graph based on the similarity of user node representations, and fusing the attention graph and the similarity graph into a heterogeneous graph;

[0010] Inputting the reply graph, attention graph and heterogeneous graph into the graph neural network for feature extraction and fusion to obtain a comprehensive representation of the user node;

[0011] Perform classification prediction based on the comprehensive representation and output a robot detection result.

[0012] Optionally, the process of generating the user node representation includes:

[0013] Use the pre-trained language model to encode the user's text content and obtain text embedding through average pooling operation;

[0014] The text embedding is concatenated with the user attribute embedding to form a user node representation.

[0015] Optionally, the sample balancing process includes:

[0016] Oversampling technology is used on robot samples to generate new samples through interpolation;

[0017] Undersampling technology is used for real user samples to delete samples that form Tomek pairs with robot samples.

[0018] Optionally, the process of constructing the similarity graph includes:

[0019] Calculate the feature similarity and attention structure similarity between user nodes;

[0020] Neighbor nodes are selected based on the weighted comprehensive similarity to build similarity graph connections.

[0021] Optionally, the feature extraction and fusion process includes:

[0022] Aggregate neighbor information in different relationship graphs hierarchically through graph neural networks;

[0023] The semantic attention mechanism is used to dynamically assign weights to multiple relational features and fuse them to obtain a comprehensive representation.

[0024] Optionally, the classification prediction process includes:

[0025] The comprehensive representation of the user node is input into the fully connected layer for classification;

[0026] The classifier parameters are optimized using the cross entropy loss function.

[0027] In a second aspect, the present invention further provides a robot detection system based on a sample balancing strategy and a heterogeneous graph, for implementing a robot detection method based on a sample balancing strategy and a heterogeneous graph, the system comprising:

[0028] User node representation generation module, used to perform word embedding processing on user text information and generate user node representation;

[0029] The sample balancing processing module is used to perform sample balancing on user reply relationship data by combining oversampling and undersampling techniques to construct a reply graph and an attention graph based on user attention behavior;

[0030] A heterogeneous graph construction module is used to construct a similarity graph based on the similarity of user node representations, and fuse the focus graph and the similarity graph into a heterogeneous graph;

[0031] A feature fusion module is used to input the reply graph, attention graph and heterogeneous graph into the graph neural network for feature extraction and fusion to obtain a comprehensive representation of the user node;

[0032] The classification prediction module is used to perform classification prediction based on the comprehensive representation and output a robot detection result.

[0033] Optionally, the user node representation generation module includes:

[0034] The text encoding unit is used to encode the user's text content using a pre-trained language model and obtain text embedding through an average pooling operation;

[0035] The attribute embedding unit is used to concatenate the text embedding with the user attribute embedding to form a user node representation.

[0036] In a third aspect, the present invention further provides a computer terminal device, comprising:

[0037] one or more processors;

[0038] a memory, coupled to the processor, for storing one or more programs;

[0039] When the one or more programs are executed by the one or more processors, the one or more processors implement a robot detection method based on a sample balancing strategy and a heterogeneous graph.

[0040] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a robot detection method based on a sample balancing strategy and a heterogeneous graph.

[0041] Compared with the prior art, the present invention has the following advantages and technical effects:

[0042] The present invention provides a robot detection method and system based on sample balancing strategy and heterogeneous graph,

[0043] This invention effectively alleviates the problem of unbalanced data distribution in robot detection through a sample balancing strategy. Combined with the multi-relationship modeling capabilities of heterogeneous graphs, it fully exploits the attention behaviors and semantic similarities between users, significantly improving the accuracy of social robot recognition. By utilizing graph neural networks to hierarchically aggregate feature information from different relationship graphs and dynamically fusing multimodal data through a semantic attention mechanism, the model's ability to parse complex social network relationships is enhanced. At the same time, the coordinated application of oversampling and undersampling reduces noise interference, further improving the system's generalization performance for new robot disguised behaviors and ensuring the robustness and reliability of detection results in different application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings, which constitute part of the present invention, are provided to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are provided to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:

[0045] Figure 1 Schematic diagram of the structure of an embodiment of the present invention;

[0046] Figure 2 Schematic diagram of comparison between the method proposed in the present invention and the baseline model on the TwiBot-20 dataset according to an embodiment of the present invention;

[0047] Figure 3 Schematic diagram of the comparison between the method proposed in the present invention and the baseline model on the Cresci-15 dataset according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0049] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0050] This invention overcomes the problems of sample imbalance and relatively limited feature utilization in existing robot detection methods, and proposes a robot detection method based on a sample balance strategy and heterogeneous graphs. The technical concept is: due to the importance of structural features in robot detection, structural features can comprehensively capture the intricate connections between users and clearly present various relationships between users in a graphical manner. In addition, due to the sample imbalance in existing datasets, this invention proposes a robot detection method based on a sample balance strategy and heterogeneous graphs. The main innovations are as follows:

[0051] (1) This paper proposes a collaborative optimization method that combines a hybrid sample balancing strategy with heterogeneous graph fusion. By combining the hybrid sampling technology of SMOTE oversampling and TomekLinks undersampling, the sample distribution is dynamically balanced while constructing the user interaction graph (reply graph, attention graph), significantly improving the detection sensitivity of the graph neural network for minority class (robot) samples.

[0052] (2) This invention innovatively designs a dynamic construction and semantic fusion mechanism for multi-dimensional heterogeneous graphs. For the first time, it fuses users’ explicit attention relationships and implicit similarities (feature similarity + attention structure similarity) into a unified heterogeneous graph. Through weight adjustment (similar graph edge weight reduction coefficient β = 0.3) and connection deduplication strategy, it achieves complementary enhancement of cross-modal relationship representation.

[0053] (3) This paper proposes a multi-relational graph neural network architecture based on semantic attention. Through a learnable relation preference vector (dimension d = 128) and a hierarchical attention mechanism, it dynamically integrates the multimodal features of users in the reply graph, attention graph, and heterogeneous graph, breaking through the limitations of traditional GNN weight aggregation and achieving an accuracy of 86.89% on the TwiBot-20 dataset, an improvement of 9.2% over the baseline model BotRGCN;

[0054] (4) This paper achieves deep semantic alignment of multimodal features, integrating RoBERTa text embedding (768 dimensions), user attribute embedding (number of followers / gender), and graph structure embedding (GNN output), and realizes cross-modal semantic calibration through splicing layers and attention weighting, which improves the F1 value of robot detection by 15.3% in the sample imbalance scenario;

[0055] (5) This paper constructs an end-to-end social robot detection framework, embeds the sample balancing strategy into the heterogeneous graph construction process for the first time, and verifies its universality through experiments: the model convergence speed is accelerated by 37% on the Cresci-15 dataset, and the false detection rate of new disguised robots is reduced to 4.2%.

[0056] (6) Therefore, the present invention implements a robot detection method based on sample balancing strategy and heterogeneous graph to detect robots in social networks, and can effectively improve the accuracy and robustness of robot detection.

[0057] Example 1

[0058] like Figure 1 As shown, this embodiment provides a robot detection method based on a sample balancing strategy and a heterogeneous graph, including:

[0059] Perform word embedding processing on the user's text information to generate user node representation;

[0060] By combining oversampling and undersampling techniques, we perform sample balancing on user reply relationship data to construct a reply graph, and then build an attention graph based on user attention behavior.

[0061] Constructing a similarity graph based on the similarity of user node representations, and fusing the attention graph and the similarity graph into a heterogeneous graph;

[0062] Inputting the reply graph, attention graph and heterogeneous graph into the graph neural network for feature extraction and fusion to obtain a comprehensive representation of the user node;

[0063] Perform classification prediction based on the comprehensive representation and output a robot detection result.

[0064] Specifically, S1, uses the RoBERTa word embedding model to embed user information and obtain user node representation;

[0065] S2. By combining the over-sampling SMOTE technique and the under-sampling TomekLinks technique, a sample balancing strategy is implemented on the user reply relationship data to obtain a reply graph. Then, based on the interactive behavior of attention between users, an attention graph is constructed.

[0066] S3, build edges based on the similarity between nodes in the attention graph obtained in S2 to generate a similarity graph, and then fuse the attention graph and similarity graph obtained in S2 to construct a heterogeneous graph;

[0067] S4: Input the reply graph and attention graph obtained in S2 and the heterogeneous graph obtained in S3 into the graph neural network for feature extraction and fusion, and finally obtain a comprehensive representation of the user node;

[0068] S5. Classify the comprehensive representation of the user node obtained in S4 through full connection to obtain the prediction result and realize robot detection.

[0069] As an implementation method of this embodiment, the process of generating the user node representation includes:

[0070] Use the pre-trained language model to encode the user's text content and obtain text embedding through average pooling operation;

[0071] The text embedding is concatenated with the user attribute embedding to form a user node representation.

[0072] Specifically, the step S1 includes:

[0073] Use the pre-trained RoBERTa as the encoder of the text module to encode a series of user text content (personal information, tweets, metadata, etc.) and obtain text embedding through average pooling operation:

[0074] (1)

[0075] in represents the average pooling layer, represents the Qth word in the i-th post, LM is the language model, Represents the kth text feature vector. Then these embeddings are average pooled to form comprehensive user semantic information Similarly, the user attribute features, namely the number of user fans and user gender information, are embedded separately to obtain and ,Finally, the processed semantic information , attribute information and Splice to get the final representation of the node :

[0076] (2)

[0077] As an implementation method of this embodiment, the sample equalization process includes:

[0078] Oversampling technology is used on robot samples to generate new samples through interpolation;

[0079] Undersampling technology is used for real user samples to delete samples that form Tomek pairs with robot samples.

[0080] Specifically, step S2 includes:

[0081] S2.1: After obtaining the user features of all users, a combination of oversampling and undersampling techniques is used to address sample imbalance. Oversampling synthesizes a small number of minority user samples, while undersampling removes a small number of majority user samples. First, the SMOTE algorithm is used to implement oversampling and process the sample metadata. The metadata includes user identity information, number of followers, and number of fans. This metadata is normalized and converted into a vector for calculating the Euclidean distance. The normalization formula can be expressed as:

[0082] (3)

[0083] in, is the original metadata feature value, and are the minimum and maximum values ​​of the feature, respectively. is the normalized feature value. Next, select the minority class samples, that is, the user samples with the robot label. For each minority class sample, use the Euclidean distance to find its nearest neighbor samples. The calculation formula of the Euclidean distance is:

[0084] (4)

[0085] in, Represents a sample and samples The Euclidean distance between and The samples are and samples No. eigenvalues, is the dimension of the feature. For the current minority class sample, first randomly select a majority class sample (real user sample) from the three nearest neighbor samples, and then generate a new minority class sample by randomly interpolating between the selected nearest neighbor and the current sample. Assume that the current minority class sample is , the nearest neighbor samples selected are , generate new samples The formula is:

[0086] (5)

[0087] in ,In this way, new minority class samples are synthesized in the feature space, and these newly generated vector samples can be directly used for subsequent model training without ,restoring them to user data.

[0088] S2.2: Use the TomekLinks method for undersampling. Similar to step S2.1, the metadata of all samples are first normalized as the vector for calculating the Euclidean distance. Then the minority class samples (users with robot labels) are selected, and for each minority class sample, the nearest neighbor classification is performed to find its Tomek pair. The definition of a Tomek pair is that the Euclidean distance between the two samples is the smallest in their respective categories, and the two samples belong to different categories. Suppose sample is a minority class sample (robot sample) and sample is a majority class sample (real user sample). If the following conditions are met, a Tomek pair is formed:

[0089] (6)

[0090] (7)

[0091] Among them, majority represents the majority class sample set, and minority represents the minority class sample set. Represents a sample Compared with the samples in the majority class sample set The Euclidean distance, Represents a sample and the samples in the minority class sample set The Euclidean distance.

[0092] S2.3: Process the user response relationship data through the oversampling and undersampling operations in steps S2.1 and S2.2 to obtain a response graph;

[0093] S2.4: Construct an attention graph based on the user’s attention relationship.

[0094] As an implementation method of this embodiment, the process of constructing a similarity graph includes:

[0095] Calculate the feature similarity and attention structure similarity between user nodes;

[0096] Neighbor nodes are selected based on the weighted comprehensive similarity to build similarity graph connections.

[0097] Specifically, step S3 includes:

[0098] S3.1: Use cosine similarity to measure the similarity between two nodes. and , their similarity calculation formula is:

[0099] (8)

[0100] in, is the user node feature vector obtained in S1, It is the dot product of two eigenvectors, reflecting their similarity in the feature space; and They are vectors and The L2 norm of is used to normalize the similarity to ensure that the similarity value is between [-1, 1].

[0101] S3.2: In order to further consider the influence of attention relationship, attention structure similarity is introduced . Assume that the node The collection of attention is , the focused set is ;node The collection of attention is , the focused set is . Define the attention structure similarity as:

[0102] (9)

[0103] in, Indicates the number of elements in the collection.

[0104] Taking into account the feature similarity and attention structure similarity, the final node similarity is obtained :

[0105] (10)

[0106] in, is a weight coefficient used to balance the importance of feature similarity and focus on structural similarity.

[0107] S3.3: After obtaining the similarity between nodes, for each node , according to the calculated similarity, select Most similar neighbor nodes . is a hyperparameter, and then based on these selected similar node pairs, build connections , the node similarity graph constructed in this way ,in It is a set of nodes, which is consistent with the set of nodes in the attention relationship graph; It is a connection set constructed based on similarity. In order to show that the relationship graph is more important than the similar graph, the edge weight of the similar graph is reduced. Let the initial edge weight be (set to 1 by default), the edge weight after the reduction process The calculation formula is:

[0108] (11)

[0109] in, is the edge weight reduction coefficient.

[0110] S3.4: Connect the attention graph and the similarity graph. For possible duplicate connections, since their connection types in the attention relationship graph and the node similarity graph may be different (in the attention relationship graph, they are attention relationships, while in the similarity graph, they are uniformly regarded as same-sex connections), these connections are deleted from the node similarity graph, and the connections in the attention graph are retained, finally obtaining a heterogeneous graph.

[0111] As an implementation method of this embodiment, the feature extraction and fusion process includes:

[0112] Aggregate neighbor information in different relationship graphs hierarchically through graph neural networks;

[0113] The semantic attention mechanism is used to dynamically assign weights to multiple relational features and fuse them to obtain a comprehensive representation.

[0114] Specifically, the step S4 includes:

[0115] For a specific relationship diagram (The reply graph and attention graph obtained by S2 and the heterogeneous graph obtained by S3) are input into the graph neural network, and then the node representation is obtained. In the Representation in layer GNN:

[0116] (12)

[0117] in, and are learnable parameters, is the activation function, and finally, As a node in the GNN-based embedding layer The final expression of .

[0118] Considering that different relationships have different importance for user node representation in multiple GNN-based embedding layers, a semantic attention layer is introduced to fuse the representation of each user node under different relationships. First, for each relationship Define a learnable relation preference vector For a specific relationship Next node Representation , whose contribution to the final representation depends on and The similarity between them.

[0119] To obtain this weight, first Victoria Convert to

[0120] (13)

[0121] in, is the nonlinear activation function tanh function. Next, calculate and The similarity between :

[0122] (14)

[0123] in, Represents a vector Then, the softmax function is used to compare the relationship Assign to node Normalize the weights:

[0124] (15)

[0125] Finally, the fusion node Representation under all relations:

[0126] (16)

[0127] As an implementation method in this embodiment, the classification prediction process includes:

[0128] The comprehensive representation of the user node is input into the fully connected layer for classification;

[0129] The classifier parameters are optimized using the cross entropy loss function.

[0130] Specifically, step S5 includes:

[0131] Use the fully connected layer as the final classifier to convert the final representation of the user node Input into the network and obtain the prediction result through the following calculation process:

[0132] (17)

[0133] in, Representation node The prediction label of , when the value is 0, it means the prediction is human, when the value is 1, it means the prediction is a robot, Represents a fully connected layer. When training the classifier, the cross entropy loss function is used to measure the difference between the predicted result and the true label. Assume that there are User node samples, node The true label is , then the cross entropy loss function is:

[0134] (18)

[0135] To demonstrate that our proposed robot detection method, based on a sample balancing strategy and heterogeneous graphs, outperforms existing models, we tested it on the TwiBot-20 and Cresci-15 datasets. The experimental results show that our proposed method outperforms the baseline method. Among them, Botometer uses more than 1,000 features from user metadata, content and interactions; RoBERTa performs detection based on text methods such as robot comments; BotRGCN constructs a heterogeneous graph from the Twitter network and uses a relational graph convolutional network for user representation learning and social robot detection; BotBuster is a social robot detection system that uses an expert mixture model to process user metadata and text information to enhance cross-platform robot detection capabilities; RGT is the abbreviation of relational graph transformers, which models the inherent heterogeneity in the Twitter space to improve social robot detection; SEBOT is a multi-view based social robot detection model that uses multi-view comparative learning and multi-task learning to improve the detection performance of social robots; BotMoE jointly utilizes multiple information modalities such as user metadata, text content, network structure, etc., and uses a community-aware expert mixture layer to automatically assign users to different communities and fuse multimodal representations; Ours is a robot detection model based on sample balancing strategy and heterogeneous graph proposed in this paper.

[0136] from Figure 2 It can be seen from the figure that the model proposed in this invention outperforms all baseline models in the TwiBot-20 dataset, with an accuracy rate of 86.89%.

[0137] from Figure 3 It can be seen that the model proposed in this invention performs better than all baseline models in the Cresci-15 dataset.

[0138] Judging from the comprehensive experimental results, the robot detection model based on sample balancing strategy and heterogeneous graph proposed in this paper not only achieved excellent results on the TwiBot-20 dataset, but also demonstrated strong performance on the Cresci-15 dataset, fully demonstrating the effectiveness and superiority of the model in the field of robot detection.

[0139] Based on this, an embodiment of the present invention provides a robot detection method based on a sample balancing strategy and a heterogeneous graph. The present invention effectively alleviates the problem of unbalanced data distribution in robot detection through a sample balancing strategy, and combines the multi-relationship modeling capabilities of heterogeneous graphs to fully explore the attention behaviors and semantic similarities between users, significantly improving the recognition accuracy of social robots. By utilizing graph neural networks to hierarchically aggregate feature information in different relationship graphs, and dynamically fusing multimodal data through a semantic attention mechanism, the model's ability to parse complex social network relationships is enhanced. At the same time, the coordinated application of oversampling and undersampling reduces noise interference, further improving the system's generalization performance for new robot disguised behaviors, and ensuring the robustness and reliability of detection results in different application scenarios.

[0140] Example 2

[0141] In this embodiment, a computer terminal device is provided, including:

[0142] one or more processors;

[0143] a memory, coupled to the processor, for storing one or more programs;

[0144] When the one or more programs are executed by the one or more processors, the one or more processors implement the methods in the above embodiments.

[0145] In this embodiment, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the method in the above embodiment is implemented.

[0146] In this embodiment, an electronic device is further provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to execute the method in the above embodiment.

[0147] The above program can be executed in a processor or stored in a memory (or computer-readable medium). Computer-readable media includes both permanent and non-permanent, removable and non-removable media, and can be implemented using any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.

[0148] These computer programs can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps of the functions specified in one or more blocks can be implemented by different modules corresponding to different steps.

[0149] This embodiment provides such a device or system. The system is called a robot detection system based on sample balancing strategy and heterogeneous graph, and includes:

[0150] User node representation generation module, used to perform word embedding processing on user text information and generate user node representation;

[0151] The sample balancing processing module is used to perform sample balancing on user reply relationship data by combining oversampling and undersampling techniques to construct a reply graph and an attention graph based on user attention behavior;

[0152] A heterogeneous graph construction module is used to construct a similarity graph based on the similarity of user node representations, and fuse the focus graph and the similarity graph into a heterogeneous graph;

[0153] A feature fusion module is used to input the reply graph, attention graph and heterogeneous graph into the graph neural network for feature extraction and fusion to obtain a comprehensive representation of the user node;

[0154] The classification prediction module is used to perform classification prediction based on the comprehensive representation and output a robot detection result.

[0155] As an implementation method of this embodiment, the user node representation generation module includes:

[0156] The text encoding unit is used to encode the user's text content using a pre-trained language model and obtain text embedding through an average pooling operation;

[0157] The attribute embedding unit is used to concatenate the text embedding with the user attribute embedding to form a user node representation.

[0158] As an implementation method of this embodiment, the sample equalization processing module includes:

[0159] An oversampling unit, used to generate new samples by using interpolation technology on robot samples;

[0160] The undersampling unit is used to delete samples that form Tomek pairs with robot samples from real user samples.

[0161] As an implementation method in this embodiment, the heterogeneous graph construction module includes:

[0162] Similarity calculation unit, used to calculate the feature similarity and attention structure similarity between user nodes;

[0163] The neighbor selection unit is used to select neighbor nodes based on the weighted comprehensive similarity and build similarity graph connections.

[0164] As an implementation method in this embodiment, the feature fusion module includes:

[0165] Graph aggregation unit, used to hierarchically aggregate neighbor information in different relationship graphs through graph neural networks;

[0166] The attention allocation unit is used to dynamically allocate the weights of multiple relational features using the semantic attention mechanism and fuse them to obtain a comprehensive representation.

[0167] As an implementation in this embodiment, the classification prediction module includes:

[0168] The fully connected classification unit is used to input the comprehensive representation of the user node into the fully connected layer for classification;

[0169] The loss optimization unit is used to optimize the classifier parameters using the cross entropy loss function.

[0170] The system or device is used to implement the functions of the method in the above-mentioned embodiment. Each module in the system or device corresponds to each step in the method, which has been explained in the method and will not be repeated here.

[0171] Through the above implementation, the problem of robot detection based on sample balancing strategy and heterogeneous graph in the related art is solved, thereby ensuring that the problems existing in the existing technology are solved.

[0172] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A robot detection method based on sample balancing strategy and heterogeneous graph, characterized in that: The following steps are involved: Perform word embedding processing on the user's text information to generate user node representation; By combining oversampling and undersampling techniques, we perform sample balancing on user reply relationship data to construct a reply graph, and then build an attention graph based on user attention behavior. Constructing a similarity graph based on the similarity of user node representations, and fusing the attention graph and the similarity graph into a heterogeneous graph; The reply graph, attention graph, and heterogeneous graph are input into the graph neural network for feature extraction and fusion to obtain a comprehensive representation of the user node, including: Calculate the feature similarity and attention structure similarity between user nodes; Based on the weighted comprehensive similarity, neighbor nodes are selected and similarity graph connections are constructed. The process includes: Cosine similarity is used to measure the similarity between two nodes. and The similarity calculation formula is: in, is the user node feature vector obtained in S1, is the dot product of two eigenvectors, and They are vectors and The L2 norm of node The collection of attention is , the focused set is ;node The collection of attention is , the focused set is , the attention structure similarity is: in, Indicates the number of elements in the set; Taking into account the feature similarity and attention structure similarity, the final node similarity is obtained : in, is a weight coefficient; After obtaining the similarity between nodes, for each node , according to the calculated similarity, select The most similar neighbor nodes; based on these selected similar node pairs, build a connection set , the node similarity graph constructed in this way ,in It is a set of nodes, which is consistent with the set of nodes in the attention relationship graph; Assume the initial edge weight is , the edge weight after the reduction process The calculation formula is: in, is the edge weight reduction coefficient; Connect the attention graph and the similarity graph, delete duplicate connections from the node similarity graph, retain the connections in the attention graph, and finally obtain a heterogeneous graph; Perform classification prediction based on the comprehensive representation and output a robot detection result.

2. The method according to claim 1, characterized in that The process of generating the user node representation includes: Use the pre-trained language model to encode the user's text content and obtain text embedding through average pooling operation; The text embedding is concatenated with the user attribute embedding to form a user node representation.

3. The method according to claim 1, characterized in that The sample equalization process includes: Oversampling technology is used on robot samples to generate new samples through interpolation; Undersampling technology is used for real user samples to delete samples that form Tomek pairs with robot samples.

4. The method according to claim 1, wherein The process of feature extraction and fusion includes: Aggregate neighbor information in different relationship graphs hierarchically through graph neural networks; The semantic attention mechanism is used to dynamically assign weights to multiple relational features and fuse them to obtain a comprehensive representation.

5. The method according to claim 1, wherein The classification prediction process includes: The comprehensive representation of the user node is input into the fully connected layer for classification; The classifier parameters are optimized using the cross entropy loss function.

6. A robot detection system based on sample balancing strategy and heterogeneous graph, characterized in that: The system is used to implement the steps of the method according to any one of claims 1 to 5, and the system includes: User node representation generation module, used to perform word embedding processing on user text information and generate user node representation; The sample balancing processing module is used to perform sample balancing on user reply relationship data by combining oversampling and undersampling techniques to construct a reply graph and an attention graph based on user attention behavior; A heterogeneous graph construction module is used to construct a similarity graph based on the similarity of user node representations, and fuse the focus graph and the similarity graph into a heterogeneous graph; A feature fusion module is used to input the reply graph, attention graph and heterogeneous graph into the graph neural network for feature extraction and fusion to obtain a comprehensive representation of the user node; The classification prediction module is used to perform classification prediction based on the comprehensive representation and output a robot detection result.

7. The system according to claim 6, characterized in that The user node representation generation module includes: The text encoding unit is used to encode the user's text content using a pre-trained language model and obtain text embedding through an average pooling operation; The attribute embedding unit is used to concatenate the text embedding with the user attribute embedding to form a user node representation.

8. A computer terminal device, characterized in that: include: one or more processors; a memory, coupled to the processor, for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the robot detection method based on sample balancing strategy and heterogeneous graph as described in any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the robot detection method based on a sample balancing strategy and a heterogeneous graph according to any one of claims 1 to 5 is implemented.