Social robot detection method based on feature engineering and graph structure
The social robot detection method combines feature engineering and graph structure, utilizes second-order features and coding features, and combines LightGBM and Louvain Method algorithms to solve the problems of existing methods in data diversity and unlabeled data utilization, and realize the detection of social robots. Efficient identification of robots.
Patent Information
- Application Number
- CN202210301232.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-03-25
AI Technical Summary
Existing social robot detection methods rely on a single algorithm, cannot effectively utilize diverse data sets, and cannot effectively utilize unlabeled data, resulting in low identification efficiency, especially on domestic social platforms. There is a problem of insufficient detection.
Using a detection method based on feature engineering and graph structure, by collecting social network behavior samples, extracting second-order features, coding features and similarity features, combined with LightGBM and Louvain Method algorithms, generate node vectors and perform community division, and use unsupervised method diffusion label to form the final prediction result.
It realizes the combination of machine learning and graph methods to deeply explore the potential characteristics of social robots, improves detection performance, can effectively utilize unlabeled data, and improves the accuracy of identifying social robots.
Smart Images

Figure CN114970664B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a social robot detection method based on feature engineering and graph structure. Background Art
[0002] In the past few decades, online social networking platforms have played an important role in influencing our daily lives. Weibo, Twitter, etc. are the most popular social platforms in the world and are one of the main channels for us to obtain social news. However, there are a large number of machine accounts, also known as social robots, in the huge social network. These accounts are not directly controlled by real people, but automatically controlled by programs. This will bring huge benefits to the people behind them. For example, they can register a large number of accounts for various purposes, such as maliciously increasing the number of fans or likes. These malicious behaviors have become an important information security issue that threatens the healthy development of social networking platforms. Therefore, it is necessary to detect social robots. In particular, current research is mostly aimed at foreign platforms such as Twitter, while there are fewer studies on domestic platforms.
[0003] Therefore, many scholars are committed to studying the detection of social robots. Currently, the work related to social robot detection can be divided into two categories, namely, user configuration-based methods and graph structure-based methods. However, the existing methods still have the following problems:
[0004] 1. Generally speaking, most methods rely on a single algorithm to identify social robots. However, due to the diversity of datasets, this approach may not be an ideal choice. First, for graph structure methods, due to the large number of nodes and small number of edges, some individual nodes may be ignored in the graph composition process. Machine learning methods cannot learn graph structures well.
[0005] 2. In practice, most data is unlabeled, which means that the number of labels is usually small. Existing methods can usually only use labeled data for training and cannot effectively use unlabeled data. Summary of the invention
[0006] The purpose of the present invention is to provide a social robot detection method based on feature engineering and graph structure, so as to achieve the purpose of solving the problems raised in the above-mentioned background technology.
[0007] To achieve the above object, the present invention provides the following technical solution: a social robot detection method based on feature engineering and graph structure, comprising the following steps:
[0008] S1: Collect enough robot and human social network behavior samples;
[0009] S2: Obtain second-order features, encoding features and similarity features according to the algorithm;
[0010] S3: Using the second-order features, encoding features and similarity features, the LightGBM algorithm is used to predict the prediction results of all users (result 1);
[0011] S4: Use the Louvain Method algorithm and rule method to obtain the prediction results of some users (result 2);
[0012] S5: Overwrite result 1 with result 2 to form the final prediction result.
[0013] Preferably, the second-order features are represented as (COUNT, UNIQUE, RATIO). Here, COUNT reflects the degree of activity. Specifically, we select a pair of variables (i.e., V1 and V2) and expect to record the number of times the pair of variables appears in the dataset. We abbreviate it as groupby(V1, V2)-count. For example, a user likes someone using a combination of device type (V1) iPhone12 and application version (V2) 126.7.0, and this combination appears k times in the dataset. Then, users using iPhone12 and 126.7.0 will get a COUNT value of k. And UNIQUE indicates a certain degree of diversity. We use one variable (V1) as the primary key and record the number of unique categories in another variable (V2). We abbreviate it as groupby(V1)[V2]-unique. For example, for users using device type (V1) iPhone12,1, there are k different application versions in the dataset. Then, users using iPhone12 will get a UNIQUE value of k. RATIO describes the ratio of counts. For RATIO, the calculation method is groupby(V1,V2)-count / groupby(V1)-count. For example, the combination of device type (V1) iPhone12 and app version (V2) 126.7.0 appears k times, and device type (V1) iPhone12 appears v times in the dataset. Then, all users using iPhone12, 126.7.0 will get a RATIO value of k / v.
[0014] Preferably, the encoding features include frequency encoding and K-fold target encoding, wherein frequency encoding replaces discrete variables with their number of occurrences in a data set, and K-fold target encoding replaces each variable with the corresponding probability of a label.
[0015] Preferably, the similarity feature represents the probability that two users have the same label. First, the Node2vec algorithm is used to obtain the node vector of the account in the graph, and then the cosine similarity between all accounts and the labeled account is calculated, and the maximum and average cosine similarities are extracted.
[0016] Preferably, the cosine similarity calculation formula between two vectors is:
[0017]
[0018] Where A and B represent the node vectors of two accounts, A i and B i Represents the elements of a vector.
[0019] Preferably, the maximum and average cosine similarity calculation formula is:
[0020] Smax1=max(S(C,D i )),D i ∈bots and C≠D i
[0021] Smean1=mean(S(C,D i )),D i ∈bots and C≠D i
[0022] Smax0=max(S(C,E i )),E i ∈humans and C≠E i
[0023] Smean0=mean(S(C,E i )),E i ∈humans and C≠E i
[0024] Where D i and E i Represents a node vector.
[0025] Preferably, the rule method is defined as follows: if users with labels belong to the same community, all users in the community are considered to belong to the same label. If users in a community do not have any labels, or users belong to different labels, no prediction will be made.
[0026] The present invention provides a social robot detection method based on feature engineering and graph structure. It has the following beneficial effects:
[0027] (1) This method combines machine learning methods with graph methods, and can deeply explore the potential characteristics of social robots in terms of user configuration and user behavior association.
[0028] (2) For feature engineering, the second-order features and encoded features used in this method have superior effects on high-cardinality variables. For graph structures, this method generates node vectors through embedding methods and then uses unsupervised methods to diffuse labels to improve performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 The figure is an overall flow chart of the detection method of the present invention. DETAILED DESCRIPTION
[0030] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0031] Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0032] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0033] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0034] like Figure 1 As shown, the present invention provides a technical solution: a social robot detection method based on feature engineering and graph structure, comprising the following steps:
[0035] S1: Collect enough robot and human social network behavior samples;
[0036] S2: Obtain second-order features, encoding features and similarity features according to the algorithm;
[0037] S3: Using the second-order features, encoding features and similarity features, the LightGBM algorithm is used to predict the prediction results of all users (result 1);
[0038] S4: Use the Louvain Method algorithm and rule method to obtain the prediction results of some users (result 2);
[0039] S5: Overwrite result 1 with result 2 to form the final prediction result.
[0040] Taking into account account profiles, account behaviors, and the relationships between them, an integrated mechanism combining feature engineering and graph methods is proposed to detect social robots. The mechanism mainly consists of three modules: feature engineering, similarity calculation, and community partitioning. First, feature engineering is performed on the dataset to extract global information. Then, node vectors are generated through an embedding method. Then, the similarity between the vectors of humans and robots is calculated. Finally, in order to further improve the performance, an unsupervised community partitioning algorithm is used. Using the proposed algorithm, these machine accounts can be easily detected. The overall process framework of the detection method is shown in the attached figure. Figure 1 Shown
[0041] This method defines second-order features and coded features as follows. These two types of features are used for discrete variables.
[0042] Second-order features: To represent the combination of discrete variables, the second-order features are represented as (COUNT, UNIQUE, RATIO). Here, COUNT reflects the degree of activity. Specifically, we select a pair of variables (i.e., V1 and V2) and expect to record the number of times the pair of variables appears in the dataset. We abbreviate it as groupby(V1,V2)-count. For example, a user likes someone using the combination of device type (V1) iPhone12 and application version (V2) 126.7.0, and this combination appears k times in the dataset. Then, users using iPhone12 and 126.7.0 will get a COUNT value of k. While UNIQUE indicates a certain degree of diversity. We use one variable (V1) as the primary key and record the number of unique categories in another variable (V2). We abbreviate it as groupby(V1)[V2]-unique. For example, for users using device type (V1) iPhone12,1, there are k different application versions in the dataset. Then, users using iPhone12 will get a UNIQUE value of k. RATIO describes the ratio of counts. For RATIO, the calculation method is groupby(V1,V2)-count / groupby(V1)-count. For example, the combination of device type (V1) iPhone12 and app version (V2) 126.7.0 appears k times, and device type (V1) iPhone12 appears v times in the dataset. Then, all users with iPhone12, 126.7.0 will get a RATIO value of k / v.
[0043] Encoding features include frequency encoding and K-fold target encoding. Frequency encoding: Discrete variables are replaced by their number of occurrences on the dataset. However, for some variables, the counts may be the same, which may cause conflicts where two variables may be encoded as the same value. Therefore, we introduce K-fold target encoding: we replace each variable with the corresponding probability of the label. The specific implementation is as follows: 1. Split the training data into K parts (K>=2). 2. Take the mean of the 2-K parts as the encoding value of the 1st part, and calculate the encoding value of the 2-K parts in the same way. 3. Use the target of the training set to determine the encoding value of the test set.
[0044] This module combines these two types of features with other continuous features to form a feature matrix output.
[0045] In the similarity calculation module, the Node2vec algorithm is first used to obtain the node embedding (vector) of the account in the graph, and then the cosine similarity between the account and the tagged account is calculated. The similarity value represents the probability that two users have the same tag. For example, if the cosine similarity between account 1 and account 2 is large, then they are likely to have the same tag with a high probability.
[0046] For example, A and B represent the node vectors of two accounts, and the cosine similarity calculation formula between the two vectors is
[0047]
[0048] Among them A i and B i Represents the elements of a vector.
[0049] Then, for each node vector in the training set and the test set, the maximum and average similarities between it and the robot / human are calculated, expressed as [Smax1, Smean1, Smax0, Smean0] as follows:
[0050] Smax1=max(S(C,D i )),D i ∈bots and C≠D i
[0051] Smean1=mean(S(C,D i )),D i ∈bots and C≠D i
[0052] Smax0=max(S(C,E i )),E i ∈humans and C≠E i
[0053] Smean0=mean(S(C,E i )),E i ∈humans and C≠E i
[0054] Where D i and E i Represents a node vector.
[0055] Then, the similarity matrix [Smax1, Smean1, Smax0, Smean0] of multiple users obtained by this module is concatenated to the feature matrix output by the previous module. Then, the concatenated matrix obtained by training the typical supervised algorithm LightGBM is used to infer the account results.
[0056] In terms of community division, the typical unsupervised algorithm Louvain Method is used, which divides the constructed graph into multiple communities. After that, the community labels are diffused using the following rules:
[0057] 1. If users with a tag belong to the same community, all users in the community are considered to belong to the same tag.
[0058] 2. If a user in a community does not have any tags, or the user belongs to different tags, we will not make predictions.
[0059] The prediction results here may not cover all users. We will overlay the results of community division into the results of the previous module to form the final prediction results.
[0060] In summary, although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A social robot detection method based on feature engineering and graph structure, characterized by: The following steps are involved: S1: Collect enough robot and human social network behavior samples; S2: Obtain second-order features, encoding features and similarity features according to the algorithm; The second-order features are (COUNT, UNIQUE, RATIO), COUNT is the number of times k that the variable pair groupby(V1, V2)-count appears in the data set; UNIQUE is the number of variables V2 corresponding to the variable pair groupby(V1) [V2]-unique in the data set; RATIO is the ratio between k and the number of times the variable V1 appears in the data set; S3: Using the second-order features, encoding features and similarity features, the LightGBM algorithm is used to obtain the prediction results of all users 1; S4: Use the Louvain Method algorithm and rule method to obtain the prediction results of some users 2; S5: Overwrite result 1 with result 2 to form the final prediction result; groupby(V1) [V2]-unique represents a pair of variables V1 and V2.
2. The social robot detection method based on feature engineering and graph structure according to claim 1, characterized in that: The encoding features of step S2 include frequency encoding and K-fold target encoding. Frequency encoding replaces discrete variables with their number of occurrences in the data set, and K-fold target encoding replaces each variable with the corresponding probability of the label.
3. The social robot detection method based on feature engineering and graph structure according to claim 1, characterized in that: The similarity feature in step S2 represents the probability that two users have the same label. First, the Node2vec algorithm is used to obtain the node vector of the account in the graph, and then the cosine similarity between all accounts and the labeled account is calculated, and the maximum and average cosine similarities are extracted.
4. The social robot detection method based on feature engineering and graph structure according to claim 3 is characterized in that: The formula for calculating the cosine similarity between two vectors is: Where A and B represent the node vectors of the two accounts, and Ai and Bi represent the elements of the vectors.
5. The social robot detection method based on feature engineering and graph structure according to claim 3, characterized in that: The maximum and average cosine similarity calculation formula is: Smax1=max(S(C,Di)),Di∈bots and C≠Di Smean1=mean(S(C,Di)),Di∈bots and C≠Di Smax0=max(S(C,Ei)),Ei∈humans and C≠Ei Smean0=mean(S(C, Ei)), Ei∈humans and C≠Ei Where Di and Ei represent a node vector.
6. The social robot detection method based on feature engineering and graph structure according to claim 1, characterized in that: The rule method of step S4 is defined as follows: if users with labels belong to the same community, all users in the community are considered to belong to the same label. If users in a community do not have any labels, or users belong to different labels, no prediction will be made.
Citation Information
Patent Citations
A System and Method to Determine the Validity of an Interaction on a Network
AU2001236953A1
A social robot detection system and method based on blog article similarity
CN109472027A
Social media robot group quick detection method
CN112685614A
Social robot detection method based on variational self-coding and K neighbor combination
CN113158076A
Anomaly detection using tripoint arbitration
US20180109531A1
