This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Social Media Bot Detection using Dropout-GAN

Anant Shukla111Department of Computer Science, San Jose State University   Martin Jureček222Faculty of Information Technology, Czech Technical University in Prague   Mark Stamp11footnotemark: 1  333mark.stamp@@sjsu.edu
Abstract

Bot activity on social media platforms is a pervasive problem, undermining the credibility of online discourse and potentially leading to cybercrime. We propose an approach to bot detection using Generative Adversarial Networks (GAN). We discuss how we overcome the issue of mode collapse by utilizing multiple discriminators to train against one generator, while decoupling the discriminator to perform social media bot detection and utilizing the generator for data augmentation. In terms of classification accuracy, our approach outperforms the state-of-the-art techniques in this field. We also show how the generator in the GAN can be used to evade such a classification technique.

1 Introduction

Social media platforms have transformed the way we communicate, interact, and consume information. However, the issue of bot activity on these platforms has become a pervasive problem, undermining the credibility of online discourse and potentially leading to cybercrime. Here, “bots” refer to computer algorithms that mimic human users, producing content, such as posting, liking, or retweeting content, and interacting with users [11].

Twitter,111Twitter has been recently renamed 𝕏\mathbb{X}. We refer to it as Twitter throughout this paper. a prominent microblogging platform, has garnered significant attention in recent years due to its pervasive problem with social media bots. This phenomenon, deeply rooted in the landscape of online communication, has become a focal point of academic research and technological discourse [3]. The proliferation of bots on Twitter has raised concerns about the integrity of information dissemination, the authenticity of user interactions, and the potential for algorithmic manipulation of public discourse.

Generative Adversarial Networks (GAN) [13] have recently gained popularity in the field of machine learning due to their ability to generate realistic synthetic data. GANs have also shown promise for their classification accuracy when attempting to distinguish users as humans or bots in a social media setting [19].

In this paper, we propose and analyze an approach to bot detection on social media platforms using GANs. Our method involves training a GAN on real and synthetic data to distinguish between genuine users and bots. We demonstrate that our approach outperforms—in terms of accuracy—the state-of-the-art techniques in this field. Furthermore, we demonstrate how this approach can be confounded by training another generator in a “Dropout-GAN” architecture, which will consistently generate bot behavior that the discriminator cannot accurately classify.

Our primary contributions can be summarized as follows:

  • Accurate bot detection — We demonstrate that GANs can be trained to accurately detect bots on social media. Specifically, we highlight how the GAN discriminator can be used for such classification.

  • Novel optimization for bot detection — We show how GANs can be further improved by using a framework that strengthens the GAN generator, to help train better performing GAN discriminators for bot detection.

  • Improved bot behavior prediction — We show that the GAN generator can be used to defeat our classification model by training against multiple discriminators to prevent the generator from overpowering the discrimnator. This can be viewed as a possible preview of how social media bots may behave in the future, and it points to directions for further research.

The remainder of this paper is organized as follows. In Section 2, we provide a brief overview of related work in bot detection. Section 3 describes our proposed approach using GANs for bot detection, and we discuss our experimental setup. Section 4 presents our results. Finally, in Section 5, we conclude with a summary of our findings and we consider future research directions.

2 Background

In this section, we first provide an overview of relevant related work. Then we introduce the various learning models that are considered in this paper, with an emphasis on GANs.

2.1 Related Work

Various techniques have been proposed for detecting bots on social media platforms, including user behavior analysis, content analysis, and network analysis [20]. One of the well-known works in user behavior analysis is the BotOrNot system [5] which relies on over a thousand features to determine whether a Twitter user’s behavior resembles that of a bot. This work was later expanded upon in [30] where the authors trained the model on a new dataset, and demonstrated which features they leveraged in their technique.

The Random Forest (RF) technique saw early success, as detailed in [4]. Another technique previously used for bot detection is boosting. For example, in [18] a modified version of AdaBoost called BoostOR was used with success, where BoostOR is optimized for F1 score by balancing the precision and recall of the classifier. Convolutional Neural Networks (CNN) have also been applied, with one example of such research being [1].

A clustering-based approach is considered in [12] where a Centroid Initialization Algorithm is used to identify malicious bot users. Some previous work has explored graph-based techniques [33], while others use deep learning models such as Long Short-Term Memory (LSTM) [16] in an attempt to deal with the challenges associated with bot detection. In addition, ensemble techniques have also been proposed, in tandem with appropriate feature selection [28]. Other research efforts have investigated the utilization of Natural Language Processing (NLP) techniques, including word embeddings [22], for improved feature encoding and representation. These prior investigations have shed light on the effectiveness of different methodologies and paved the way for further advancements in the realm of bot detection and analysis. Building upon these existing foundations, this study aims to contribute novel insights by employing an extensible open framework that integrates multiple discriminators in the training process.

Work has been previously done using GANs to identify social media bots [19]. However, in our approach, we propose a simpler architecture, and we expand the concept of using GANs for social media bot detection to a multilingual dataset. The dataset we use includes tweets from 54 languages, and our method also outperforms the previous work in [19], in terms of accuracy and other relevant metrics such as precision, recall, F1 score, and so on.

2.2 Bot Detection Techniques

Bot detection techniques can be broadly classified into two categories: feature-based techniques and graph-based techniques. Feature-based techniques rely on features such as user behavior, content, and so on, whereas graph-based techniques emphasize the use of graph analysis to detect bot activity. Such graph analysis may focus on aspects such as network properties, graph structure, and spatial information like proximity to other humans or bots [20].

2.2.1 Feature Based Techniques

Feature-based techniques for bot detection on social media platforms rely on features such as user behavior, content, and network properties. AdaBoost, Random Forest, Decision Trees, Support Vector Machines (SVM), kk-Nearest Neighbors (kk-NN), Multilayer Perceptrons (MLP), and Logistic Regression [20] are examples of feature-based techniques that have been used in bot detection. These techniques are trained on a set of labeled data, where the features are extracted from user behavior, content, and other properties such as tweet metadata. The trained classifier then uses these features to distinguish between genuine users and bots.

Feature-based techniques are used for bot detection due to their ability to handle high-dimensional data and their ability to detect complex relationships between features. However, these methods are susceptible to sophisticated bots that may modify the features that are scrutinized for detection, and thereby evade feature-based detection methods [2].

2.2.2 Graph Based Techniques

Graph-based techniques for bot detection on social media platforms use graph analysis to detect bot activity. Such techniques often work by analyzing the structure of the social media network and identifying patterns of bot activity, such as bots that are part of a botnet or bots that are using the same IP address. These techniques can detect sophisticated bots that are difficult to detect using feature-based techniques. However, graph-based techniques are generally computationally expensive, and may not be feasible for larger graphs [32]. The following graph-based learning techniques have been applied to the bot detection problem:

  • Graph Convolutional Networks (GCN)

  • GraphSAGE (SAmple and aggreGatE)

  • Graph Attention Networks (GAT)

  • Heterogeneous Graph Transformers (HGT) [14]

  • Hamiltonian Generative Networks (HGN) [29]

  • BotRGCN [10]

  • Relational Graph Transformers (RGT) [8]

2.3 GAN

Generative Adversarial Networks (GANs) are a class of deep learning models that were introduced in [13]. GANs consist of two components, namely, a generator and a discriminator. The generator produces synthetic data that is meant to resemble real training data, while the discriminator tries to distinguish between real data and the synthetic data produced by the generator.

GANs have been applied to a wide range of tasks, such as image and text generation [15], and anomaly detection [23]. In the context of bot detection on social media platforms, GANs can be used to model the behavior of bots by training the generator to produce synthetic bot behavior that resembles real bot behavior.

The discriminator in the GAN can be used to detect social media bots by training it to distinguish between genuine user behavior and synthetic bot behavior. The discriminator can be trained on a dataset of labeled data where the labels indicate whether a user is a bot or not. The discriminator then learns to identify patterns in the data that are characteristic of bot behavior. Once the discriminator is trained, it can be used to detect bots in new data that it has not seen before.

The generator in the GAN can be used to model social media bots by training it to produce synthetic bot behavior that resembles real bot behavior. The generator is trained on a dataset of labeled data where the labels indicate whether a user is a bot or not. The generator then learns to produce synthetic bot behavior that is similar to the behavior of real bots in the dataset. This synthetic data can serve to strengthen the discriminator, while the generator-produced data provides additional examples of potential bot behavior.

3 Implementation

In this section, we first discuss the dataset used in our experiments. We then turn our attention to the training of the GAN models that are the focus of our research.

3.1 Dataset

The MGTAB [24] dataset exhibits substantial potential as a foundation for bot research due to its remarkable wealth of data. The authors created a new graph-based dataset by selecting 100 seed accounts actively engaged in discourse about Japan’s plan to release nuclear wastewater into the ocean, then collecting the 10,000 most recent tweets for each user, eventually accumulating a total 1,554,000 users and 135,450,000 tweets. After cleaning, they retain 410,199 users and roughly 40 million tweets. However, not all these users and tweets are labeled; only 10,199 users and their associated tweets were manually annotated to describe whether they were bot accounts or human accounts, and also have other labels that are relevant for stance detection (“neutral”,“against”,“support”), but were not used in our research. The authors of [24] employ many contemporary machine learning techniques, as well as graph-based machine learning techniques to determine their performance on the dataset. These results serve to benchmark the performance against previous datasets as well. By virtue of its versatile combination of feature-based and graph-based characteristics, this dataset is highly conducive to effective experimentation and analysis.

Twibot-22 [9] also stands out as a notable dataset, particularly due to influencing the emergence of the BotRGCN technique [10], which currently ranks among the most successful graph-based methodologies for bot detection. Notably, this technique achieves an impressive accuracy of 87.2% on the MGTAB dataset and 79.7% on the Twibot-22 benchmark. The authors built a new dataset by starting from the @NeurIPSConf account, and then using its first 1000 followers and followees as candidates for BFS expansion. They then randomly adopt one of two sampling strategies: distribution diversity or value diversity, and randomly select metadata, to include six users from its neighborhood into the dataset. The dataset itself comprises 92,932,326 users and 170,185,937 follow relationships. Each user has its first 1000 tweets collected as well. Like MGTAB, Twibot-22 also tested a variety of learning techniques which serve as benchmarks.

We selected the MGTAB dataset for our experiments. This dataset contains a mix of genuine users and bots. It contains both feature and graph information, but we use the feature data exclusively, which serves to simplify the training process. There are 788 features in total, with the 20 best features, based on Information Gain (IG), listed in Table 1.

Table 1: Top 20 features in MGTAB based on information gain

Feature Description Type IG followers friends ratio Followers/friends Numerical 0.391857 listed count Public members list Numerical 0.333101 description length Length of description Numerical 0.194765 followers count Number of followers Numerical 0.176186 URL URL set or not Boolean 0.064248 name length Length of name Numerical 0.040335 created Time account created Numerical 0.034079 friends count Number of friends Numerical 0.031598 profile Default or not Boolean 0.025997 profile image Default or not Boolean 0.025402 sidebar border color Default or not Boolean 0.023105 sidebar fill color Default or not Boolean 0.022359 geographic location Enabled or not Boolean 0.019302 statuses count Tweets and retweets Numerical 0.015544 favorites count Account likes Numerical 0.011768 verified Verified or not Boolean 0.010902 background image Use or not Boolean 0.007877 screen name length Self-explanatory Numerical 0.007641 profile background URL Present or not Boolean 0.005923 profile background color Default or not Boolean 0.005841

There are 410,199 total accounts in the MGTAB data that we use in our experiments, and each account has its 10,000 most recent tweets included. Table 2 provides more details on this MGTAB data.

Table 2: Accounts in MGTAB dataset

Humans Bots Unlabeled Total 7,451 2,748 400,000 410,199

The dataset has already undergone preprocessing, utilizing Language-agnostic BERT Sentence Embedding (LaBSE) [7] for feature encoding. LaBSE expands upon the ideas of BERT [6] to multilingual and cross-lingual sentence embeddings, which works well for our use case since the dataset contains 54 languages. The LaBSE model also performs strongly on those languages where LaBSE does not have any explicit training data, likely due to language similarity and the massively multilingual nature of the model.

Additionally, minmax scaling has been applied to normalize all features within the range of 0 to 1. This meticulous preprocessing renders the dataset readily utilizable without the need for further preprocessing. We divided the dataset into training, validation, and testing sets based on an 80-10-10 split, respectively.

3.2 Feature Selection

Even though the dataset has been preprocessed, we carried out some experimentation to determine which combination of features will be optimal. We experimented using different feature vector sizes, specifically, selecting 20 features, 50 features, and 100 features, based on descending order of information gain. We found that using the first 100 features ranked by information gain is optimal for our GAN models, while other techniques we also experimented with (listed in Table 4) seemed to benefit the most from using the first 50 features, again, ranked by information gain.

Refer to caption

Figure 1: GAN metrics as a function of the number of features

3.3 Training: Regular GAN

Figure 2 depicts the initial setup that we used to train our GAN models. The initial goal was on training a discriminator that can distinguish between bots and humans accurately.

Table 3 provides an overview of the hyperparameters explored during a comprehensive grid search experiment. This search aimed to determine a near-optimal configuration for our GAN discriminator model. The best-performing values (in terms of test accuracy) are presented in bold text in Table 3. These values were obtained by performing the grid search on the 10,499 labeled users that MGTAB provides.

Table 3: Hyperparameters tested (selected values in boldface)

Hyperparameter Search space Type Learning Rate 0.001,0.002,,0.01,,0.10.001,\textbf{0.002},\ldots,0.01,\ldots,0.1 Continuous Batch Size 32,64,128,25632,64,128,\textbf{256} Discrete Activation Function Sigmoid, ReLU, LeakyReLU Categorical Optimizer Adam, SGD Categorical Noise Dimension 100 Fixed Dropout Rate 0.0,0.1,0.2,,0.5,,10.0,0.1,0.2,\ldots,\textbf{0.5},\ldots,1 Continuous Number of Epochs 10,25,50,10010,25,\textbf{50},100 Discrete Number of Linear Layers (Discriminator) 1,2,3,4,,201,2,\textbf{3},4,\ldots,20 Discrete Number of Linear Layers (Generator) 1,2,3,4,,201,2,\textbf{3},4,\ldots,20 Discrete

We train all of our GAN models using the PyTorch [21] framework. From Table 3, we observe that our best results are obtained using the Adam optimizer with a learning rate of 0.002 and a batch size of 256. We train our models for 50 epochs. During training, we optimized the discriminator and generator models using the binary cross-entropy loss function, combined with a sigmoid layer. The discriminator was trained to distinguish between genuine user behavior and bot behavior, in both real samples, and samples produced by the generator. Essentially, we use the generator as a sort of data augmentation technique. The generator was trained to produce synthetic bot behavior that resembles real bot behavior. We trained a discriminator that is able to predict whether a user is a human user or a bot user with 99.3% accuracy - this was our best-performing discriminator after utilizing the optimal hyperparameters that we discovered during our grid search earlier. From now on, we will refer to the best-performing discriminator as D*.

Refer to caption

Figure 2: Training setup for GAN

3.4 Training: Dropout GAN

Our investigation revealed that a conventional GAN setup employed for bot prediction demonstrates commendable efficacy in bot identification. However, this success stems from the discriminator completely overwhelming the generator—or at the very least, at a notable cost to the generator’s performance. Around epoch 25, clear indications of mode collapse became evident, as the generator predominantly generated a limited subset of outputs. In our particular case, the generator produced synthetic bot results at a much higher rate than synthetic human results. Ideally, we should have about an equal chance of generating one or the other. Due to this issue of mode collapse, the discriminator D* would only guess that a potential user is a bot, which negatively impacted the F1 score of the discriminator.

Figure 3 shows the bot-to-human ratio, as a function of training epoch. Whereas the ideal ratio is about 1-to-1, from Figure 3 we observe that the ratio is elevated after just 25 epochs, and reaches nearly 50-to-1 by epoch 30. Consequently, the discriminator assumed that generated samples were bots, and no improvement in learning could then take place. We initially experimented with adding dropout layers to the discriminator and generator, but that was not effective in alleviating the problem. We also tried tweaking the learning rate of both the discriminator and generator, but that did not improve the situation either.

Refer to caption

Figure 3: Mode collapse visualized

The research in [17] inspired an approach that we found to be successful for dealing with the problem of mode collapse. Specifically, we found that a “many-discriminator, one-generator” GAN architecture, which is known as a Dropout-GAN, mitigated the issue of mode collapse. Figure 4 illustrates this Dropout-GAN approach.

Refer to caption

Figure 4: Dropout-GAN architecture

In contrast to conventional GAN configurations, the Dropout-GAN approach involves training the generator against multiple discriminators within each epoch. We randomly choose a subset of discriminators to train against the generator every epoch, which is similar to the mechanism of neuron deactivation, or “dropout,” in a conventional neural network. Dropout is a powerful regularization technique widely employed in conventional neural networks to mitigate overfitting. Dropout operates by randomly deactivating a fraction of neurons during each forward and backward pass of training. This stochastic dropout of neurons ensures that the network does not rely too heavily on a small subset of neurons while others atrophy. In effect, dropouts enhance generalization and reduce overfitting by preventing the neural network from simply memorizing the training data.

In our Dropout-GAN training step, the generator is trained against a discriminator with a certain probability. If this probability surpasses a predetermined threshold, it triggers the training of the discriminator against the generator. Conversely, if the probability falls below the threshold, the discriminator is excluded from the training process, and its involvement in the training step for the epoch is effectively nullified. Per epoch, each discriminator is randomly selected for training (or not) based on a specified threshold. This training process is illustrated in Figure 5.

Refer to caption

Figure 5: Training setup for Dropout-GAN

Training the generator against multiple discriminators proved to be effective. Figures 6(a) illustrate the discriminator vs generator loss for a conventional GAN, whereas Figures 6(b) illustrate the discriminator vs generator loss for our Dropout-GAN architecture. For the conventional GAN, the discriminator overwhelms the generator, as indicated by a significant decline in discriminator loss. In contrast, for the Dropout-GAN architecture, the discriminator and generator losses remain comparatively evenly matched—we see that the generator does not get overwhelmed by the discriminator even after 100 epochs. In contrast, mode collapse begins after 25 epochs for a conventional GAN. Even when the discriminator(s) seem to have the advantage in terms of discriminator loss vs generator loss, the generator in a Dropout-GAN is able to adapt and remain roughly on par with its competition, in terms of loss.

Refer to caption

(a) Conventional GAN

Refer to caption

(b) Dropout-GAN

Figure 6: Discriminator vs generator loss

Note that we do not segregate humans and bots during Dropout-GAN training, similar to our conventional GAN training. Hence, we use both human and bot samples for training. But in contrast to our conventional GAN training, during Dropout-GAN training, the discriminators were only tested on whether they are able to distinguish the generated samples from the real samples, where the “real” samples could be either humans or bots. Thus, the generator was evaluated on whether it could produce convincing synthetic human and bot samples, and the discriminator loss was dependent on whether they could differentiate between real data versus the synthetic data generated by the generator. In the conventional GAN setup, in contrast, the emphasis was on whether the discriminator could differentiate between human users and bot users, working on a dataset containing both real data, and synthetic data with synthetic labels. Note that at the end of the Dropout-GAN training process, we obtain a best-performing generator G* that is resilient to mode collapse even when training against our best-performing discriminator, D*.

Initially, we want to train a generator that can create convincing duplicates of both humans and bots. Once we have a functional generator, we use the best-performing discriminator D* from our original GAN implementation to train against this new generator, to further refine its capabilities and enhance its performance when detecting social media bots. Using this approach, we retain the early performance gains of our discriminator (and consequently ensure that it, in turn, does not get overwhelmed by the generator) as well as create a generator that can accurately model bot behavior. This allows the model to accurately classify users as humans or bots, regardless of their ratio in a test sample.

4 Dropout-GAN Results

In this section, we evaluate our Dropout-GAN discriminator architecture for bot detection, based on the MGTAB dataset. As mentioned above, we use an 80-10-10 training-test-validation split, and hence our classification results are based on 1050 users (746 humans, 304 bots on average in 10 runs) out of the 10,499 in MGTAB.

The results in Figure 7 show the test accuracy and loss when training the discriminator model D* from our conventional GAN against the G* obtained from a Dropout-GAN, with the number of discriminators in the Dropout-GAN ranging from 1 to 10. We observe that five discriminators training against one generator yields the best results.

Refer to caption

Figure 7: D* test accuracy and loss vs number of discriminators when training G*

We also compare the performance of our best-performing Dropout-GAN discriminator D* to standard feature-based learning techniques; specifically, SVM, kk-NN, MLP, and Random Forest. We test these standard classifiers on the same benchmark MGTAB dataset. The results of these classification experiments are summarized in Table 4. We observe that our Dropout-GAN approach outperforms all of the standard techniques tested by a wide margin. Our Dropout-GAN approach achieves an accuracy of 99.3%, as compared to a best result of slightly over 90% for the standard techniques.

Table 4: Comparison to selected baseline techniques

Technique Accuracy Precision Recall F1-score kk-NN 82.94 79.20 76.88 77.88 SVM 88.62 86.08 85.27 85.66 MLP 89.22 86.89 85.90 86.37 RF 90.49 88.49 87.54 88.00 Dropout-GAN 99.3 99.23 99.10 99.00

Table 5 summarizes the results of our best performing Dropout-GAN discriminator to previous work involving the same MGTAB dataset. Our approach outperforms all previous work, for each of the metric shown in the table.

Table 5: Comparison to previous work

Technique Accuracy Precision Recall F1-score OS-GNN [26] 87.18 85.39 RF-GNN [27] 87.86 83.99 HOFA [31] 88.68 79.21 RGT [24] 92.12 88.08 86.64 90.41 MSGS [25] 96.59 96.27 Dropout-GAN (this paper) 99.3 99.23 99.10 99.00

In Figure 8 we provide a bar graph that summarizes the error rate results for our Dropout-GAN approach in comparison to previous research, as well as in comparison to the baseline techniques considered in this paper. We obtain a nearly 3% improvement over the best previous work, and a more than 10% improvement, as compared to the best of the baseline techniques.

05510101515kk-NNSVMMLPRFOS-GNN [26]RF-GNN [27]HOFA [31]RGT [24]MSGS [25]Dropout-GAN (our research)15.2015.2012.5512.5511.8611.8610.9810.9812.8212.8212.1412.1411.3211.327.887.883.413.410.700.70Error rate (1accuracy1-\mbox{accuracy}) as a percentage
Figure 8: Error rate comparisons

We also tested the best-performing discriminator D* when augmenting the dataset using the best-performing generator G* from the Dropout-GAN framework. Our goal is to determine the effect of GAN-based data augmentation. We find that varying the ratio of real data to augmented data does not yield large differences—varying from 50% synthetic data to 100% synthetic data, the test accuracy and test loss only changes by 0.08, based on the mean value of 10 experiments. Below 50% synthetic data, the best-performing discriminator proved resilient to “noise” and displayed performance in line with the results given in Tables 5 and 4, above.

Refer to caption

Figure 9: D* test accuracy vs data augmentation ratio

Through additional experimentation, we explored the scenario of multiple discriminators training against one generator in the Dropout-GAN framework. For a sufficient number of discriminators, we find that a trained generator G* is able to consistently confound the best-performing discriminator D*, when repurposing D* to distinguish between real data and G*-generated samples, and testing its accuracy in this classification. Specifically, in this scenario, the discriminator’s accuracy plummeted to 48% when five or more discriminators are used. This suggests that the generator may be able to generate new kinds of bot behavior (and potentially, human behavior) that the discriminator cannot classify, potentially suggesting possible behavior of social media bots in the future. Table 6 provides additional details on these experiments.

Table 6: Best performing discriminator vs best performing generator

Discriminators D* test accuracy D* test loss when training G* 01 0.615845 0.770240 02 0.981028 0.418309 03 0.981028 0.667282 04 0.981028 0.628062 05 0.481028 2.116829 06 0.481028 2.060582 07 0.481028 1.515876 08 0.481028 1.269565 09 0.481028 2.246191 10 0.481028 6.534316

Ideally, a technique should be able to predict whether an account is controlled by a human or bot as soon as possible. We created an experiment to examine the performance of the techniques under scrutiny, by segregating accounts into percentile categories based on the date of creation and then testing the techniques on one particular category at a time.

Figure 10 shows the results of this experiment. As expected, all techniques examined perform sub-optimally when tested on newer accounts since they do not have enough posts or interactions with other accounts to make a definitive decision, leading to a higher error rate in classification. As time passes and the accounts age, the performance improves—we see a marked improvement in classification accuracy across all techniques once we test against accounts in the 35th35^{\operatorname{th}} percentile (or older) with respect to the “created date”. Predictably, once enough time has passed, the techniques can reliably classify accounts into humans or bots, and more information does not help the classification process further, which accounts for the eventual plateauing of performance.

Refer to caption

Figure 10: F1 score on nthn^{\operatorname{th}} percentile based on “created date” test sets

We also quantify the impact of each prediction that our model makes. Assuming that our model is being used in some social media platform, we want to determine the consequences of automatically banning that particular account, if classified as a bot account by our model. To this end, we define a new metric that we call impact. Here, impact is defined as the product of the number of followers, FF, and the number of posts, PP, normalized over all candidate accounts, that is,

impact=FPi=1nFiPi\mbox{{impact}}=\frac{FP}{\displaystyle\sum_{i=1}^{n}F_{i}P_{i}}

where the sum is over all users

We can now calculate the impactmitigation of classifications across the testing set. If a model correctly classifies a particular account, we define the impact associated with that particular account as “mitigated”, i.e., if that particular account was a bot, then banning that account results in a positive impact. In these cases, we will add the impact associated with the account to the impactmitigation. On the other hand, if we misclassify a human as a bot and ban them, then the impact is negative—we do not want to ban real users by accident, and we do not want bot accounts to remain undetected. So, in the cases of misclassification, we subtract the impact associated with this account from the total impact. Thus, we have

impactmitigation=i=1nimpacti\mbox{{impact\kern-1.0pt{\ooalign{\hbox{\set@color\phantom{M}}\cr\rule[-1.75pt]{9.16669pt}{0.75pt}}}mitigation}}=\sum_{i=1}^{n}\mbox{{impact}}_{i}

Note that 1impactmitigation1-1\leq\texttt{impact\kern-1.0pt{\ooalign{\hbox{\set@color\phantom{M}}\cr\rule[-1.75pt]{9.16669pt}{0.75pt}}}mitigation}\leq 1, since misclassifying every sample in the test set will have an impactmitigation of 1-1, while correctly classify every account, then we will have an impactmitigation of 11. Figure 11 illustrates the performance of various techniques with respect to this impactmitigation metric. Again, we see that our GAN-based approach performs best.

Refer to caption

Figure 11: Impact mitigation comparison

We also explored the features that our best-performing generator G* is relying on to confound our best-performing discriminator D*. To this end, we examined the features that were “close” to real human accounts, where we define close as being within 5% of the average value for a human account, for a particular feature. The results of these experiments are summarized in Figure 12.

Refer to caption

Figure 12: Generator features close to human features

From Figure 12, we observe that the specific attributes that contribute the most to human-like classification are the counts of followers, friends, and favorites. Our D* discriminator appears to rely heavily on these attributes to differentiate between human users and automated bots. Upon further investigation, we found that these three attributes were present in all instances of false positives observed during the D* testing phase. Additionally, an account’s “verified” status on Twitter has historically served as a reliable indicator of its human authenticity, although this has certainty diminished with the advent of the option to purchase “verified” status. The follower-friend ratio and the account’s age closely follow in significance as criteria aiding in the classification process. These results demonstrate that the generator trained in the Dropout-GAN architecture is able to produce synthetic bot and human behavior that is difficult to distinguish from their respective real counterparts.

Our results indicate that the Dropout-GAN has the potential to simulate sophisticated bots that are difficult to detect using methods that work well to detect bots based on current bot data. Overall, our results demonstrate that we can detect social media bots effectively, while there also exist mechanisms to potentially confound current state-of-the-art models.

5 Conclusion and Future Work

In this paper, we proposed a novel approach to bot detection using Dropout-GANs. Our best performing discriminator D* outperformed state-of-the-art techniques in terms of accuracy and hence provides a promising approach for detecting current social media bots.

We leveraged using multiple discriminators to train one generator in the Dropout-GAN, then trained our best performing discriminator D* to detect social media bots by training it to distinguish between genuine user behavior and synthetic bot behavior produced by the best performing generator G*. This allows the model to identify patterns in the data that are characteristic of bot behavior. Perhaps most intriguing of all, we also demonstrated that the generator in the Dropout-GAN architecture can be used to model social media bots by training it to produce synthetic bot behavior that resembles real bot behavior.

Overall, our approach provides a promising direction for detecting current social media bots, and points to directions for future research into the detection of more challenging bots. Our method can be applied to a wide range of social media platforms and can help to ensure that online discourse is more authentic and trustworthy.

Future work could explore whether GANs can be applied to detecting social media bots across different social media platforms, since the dataset used for this work only included posts from one platform, i.e., Twitter. Additional future investigations may also consider the extension of our approach to datasets beyond social media bots to validate its applicability across different domains. Another area for exploration could be experimenting with more types of layers for the GAN model, such as LSTM layers or convolutional layers. One could also investigate how bots can reverse-engineer such models and overcome them with new behavior that may not be captured by our generator. One could also repeat the experiments with graph-based techniques such as HGT, GAT, GCN, and so on.

References

  • [1] Chiyu Cai, Linjing Li, and Daniel Zeng. Detecting social bots by jointly modeling deep behavior and content information. In Proceedings of the 2017 ACM on Conference on Information and Knowledge Management, pages 1995–1998, 2017.
  • [2] Stefano Cresci, Roberto Di Pietro, Marinella Petrocchi, Angelo Spognardi, and Maurizio Tesconi. The paradigm-shift of social spambots: Evidence, theories, and tools for the arms race. In Proceedings of the 26th International Conference on World Wide Web Companion, pages 963–972, 2017.
  • [3] Stefano Cresci, Roberto Di Pietro, Angelo Spognardi, Maurizio Tesconi, and Marinella Petrocchi. Demystifying misconceptions in social bots research. https://arxiv.org/abs/2303.17251, 2023.
  • [4] Isaac David, Oscar S Siordia, and Daniela Moctezuma. Features combination for the detection of malicious twitter accounts. In 2016 IEEE International Autumn Meeting on Power, Electronics and Computing, ROPEC, pages 1–6, 2016.
  • [5] Clayton Allen Davis, Onur Varol, Emilio Ferrara, Alessandro Flammini, and Filippo Menczer. Botornot: A system to evaluate social bots. In Proceedings of the 25th International Conference Companion on World Wide Web, pages 273–274, 2016.
  • [6] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. https://arxiv.org/abs/1810.04805, 2018.
  • [7] Fangxiaoyu Feng, Yinfei Yang, Daniel Cer, Naveen Arivazhagan, and Wei Wang. Language-agnostic BERT Sentence Embedding. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics, volume 1, pages 878–891, 2022.
  • [8] Shangbin Feng, Zhaoxuan Tan, Rui Li, and Minnan Luo. Heterogeneity-aware twitter bot detection with relational graph transformers. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 3977–3985, 2022.
  • [9] Shangbin Feng, Zhaoxuan Tan, Herun Wan, Ningnan Wang, Zilong Chen, Binchi Zhang, Qinghua Zheng, Wenqian Zhang, Zhenyu Lei, Shujie Yang, et al. TwiBot-22: Towards graph-based Twitter bot detection. Advances in Neural Information Processing Systems, 35:35254–35269, 2022.
  • [10] Shangbin Feng, Herun Wan, Ningnan Wang, and Minnan Luo. BotRGCN: Twitter bot detection with relational graph convolutional networks. In Proceedings of the 2021 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining, pages 236–239, 2021.
  • [11] Emilio Ferrara, Onur Varol, Clayton Davis, Filippo Menczer, and Alessandro Flammini. The rise of social bots. Communications of the ACM, 59(7):96–104, 2016.
  • [12] Suruchi Gera and Adwitiya Sinha. T-Bot: AI-based social media bot detection model for trend-centric Twitter network. Social Network Analysis and Mining, 12(1):76, 2022.
  • [13] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. Communications of the ACM, 63(11):139–144, 2020.
  • [14] Ziniu Hu, Yuxiao Dong, Kuansan Wang, and Yizhou Sun. Heterogeneous graph transformer. In Proceedings of the Web Conference 2020, pages 2704–2710, 2020.
  • [15] Sanaa Kaddoura. A Primer on Generative Adversarial Networks. Springer Nature, 2023.
  • [16] Sneha Kudugunta and Emilio Ferrara. Deep neural networks for bot detection. Information Sciences, 467:312–322, 2018.
  • [17] Gonccalo Mordido, Haojin Yang, and Christoph Meinel. Dropout-GAN: Learning from a dynamic ensemble of discriminators. 24th ACM SIGKDD Conference On Knowledge Discovery and Data Mining, 2018.
  • [18] Fred Morstatter, Liang Wu, Tahora H. Nazer, Kathleen M. Carley, and Huan Liu. A new approach to bot detection: striking the balance between precision and recall. In 2016 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining, ASONAM, pages 533–540, 2016.
  • [19] Shaghayegh Najari, Mostafa Salehi, and Reza Farahbakhsh. GANBOT: A GAN-based framework for social bot detection. Social Network Analysis and Mining, 12:1–11, 2022.
  • [20] Mariam Orabi, Djedjiga Mouheb, Zaher Al Aghbari, and Ibrahim Kamel. Detection of Bots in Social Media: A Systematic Review. Information Processing & Management, 57(4):102250, 2020.
  • [21] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, volume 32, pages 8024–8035. Curran Associates, Inc., 2019.
  • [22] Jeffrey Pennington, Richard Socher, and Christopher D Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing, EMNLP, pages 1532–1543, 2014.
  • [23] Thomas Schlegl, Philipp Seeböck, Sebastian M Waldstein, Georg Langs, and Ursula Schmidt-Erfurth. f-AnoGAN: Fast unsupervised anomaly detection with generative adversarial networks. Medical Image Analysis, 54:30–44, 2019.
  • [24] Shuhao Shi, Kai Qiao, Jian Chen, Shuai Yang, Jie Yang, Baojie Song, Linyuan Wang, and Bin Yan. MGTAB: A multi-relational graph-based twitter account detection benchmark. https://arxiv.org/abs/2301.01123, 2023.
  • [25] Shuhao Shi, Kai Qiao, Zhengyan Wang, Jie Yang, Baojie Song, Jian Chen, and Bin Yan. Muti-scale graph neural network with signed-attention for social bot detection: A frequency perspective. https://arxiv.org/abs/2307.01968, 2023.
  • [26] Shuhao Shi, Kai Qiao, Jie Yang, Baojie Song, Jian Chen, and Bin Yan. Over-sampling strategy in feature space for graphs based class-imbalanced bot detection. https://arxiv.org/abs/2307.01968, 2023.
  • [27] Shuhao Shi, Kai Qiao, Jie Yang, Baojie Song, Jian Chen, and Bin Yan. RF-GNN: Random forest boosted graph neural network for social bot detection. https://arxiv.org/abs/2304.08239, 2023.
  • [28] Hrushikesh Shukla, Nakshatra Jagtap, and Balaji Patil. Enhanced twitter bot detection using ensemble machine learning. In 2021 6th International Conference on Inventive Computation Technologies, ICICT, pages 930–936, 2021.
  • [29] Peter Toth, Danilo Jimenez Rezende, Andrew Jaegle, Sébastien Racanière, Aleksandar Botev, and Irina Higgins. Hamiltonian generative networks. https://arxiv.org/abs/1909.13789, 2019.
  • [30] Onur Varol, Emilio Ferrara, Clayton Davis, Filippo Menczer, and Alessandro Flammini. Online human-bot interactions: Detection, estimation, and characterization. In Proceedings of the International AAAI Conference on Web and Social Media, volume 11, pages 280–289, 2017.
  • [31] Sen Ye, Zhaoxuan Tan, Zhenyu Lei, Ruijie He, Hongrui Wang, Qinghua Zheng, and Minnan Luo. HOFA: Twitter bot detection with homophily-oriented augmentation and frequency adaptive attention. https://arxiv.org/abs/2306.12870, 2023.
  • [32] Ziwei Zhang, Peng Cui, and Wenwu Zhu. Deep learning on graphs: A survey. IEEE Transactions on Knowledge and Data Engineering, 34(1):249–270, 2020.
  • [33] Jun Zhao, Xudong Liu, Qiben Yan, Bo Li, Minglai Shao, and Hao Peng. Multi-attributed heterogeneous graph convolutional network for bot detection. Information Sciences, 537:380–393, 2020.