# Effective Bots’ Detection for Online Smartphone Game Using Multilayer Perceptron Neural Networks

Authors: Woei-Jiunn Tsaur; Chinyang Henry Tseng; Chin-Ling Chen
Journal: Security and Communication Networks
 (2022)

---

## Abstract

Online smartphone game bots can cause unfair behaviors and even shorten the game’s life cycle. The random forest algorithm in machine learning is a widely used solution to identify game bots through behavioral features. Although the random forest algorithm can exactly detect more definite game bot players, some players belonging to the gray area cannot be detected accurately. Therefore, this study collects players’ data and extracts the features to build the multilayer perceptron, neural network model, for effectively detecting online smartphone game bots. This approach calculates each player’s abnormal rate to judge game bots and is evaluated on the famous mobile online game. Based on these abnormal rates, we then useK means to cluster players and further define the gray area. In the experimental evaluation, the results demonstrate the proposed learning model has better performance, not only increasing the accuracy but also reducing the error rate as compared with the random forest model in the same players’ dataset. Accordingly, the proposed learning model can detect bot players more accurately and is feasible for real online smartphone games.


---

## Body

## 1. Introduction

With the popularity of smartphones, the market of mobile online games has become more and more prosperous in recent years. The mobile online game bot is an automated program playing games autonomously instead of human users. Without any touch from a human, bots can automatically move around in a virtual world. They behave in a programmed way and repetitively do patterned actions to collect game assets. Bots can gather game wealth faster than normal players because the bot program does not get tired [1, 2]. Consequently, bots will endanger the rights of mobile online game players. For a normal player, for example, after he/she practices continuously, his/her game score should grow slowly. However, if the player suddenly increases many thousand or even ten thousand scores within a short period of time, he/she may be abnormal to use game bots. When game bots are spread, the behaviors of using bots will break the rule of the whole game and lead to the dissatisfaction of normal players. Mobile online game bots have recently become an essential security issue that must be solved to protect game assets.Game bots’ detection is one of the defensive mechanisms against game bots [3]. However, it is frequently misjudged by players as game bots because some players may spend a lot of time playing the game, which makes their score data look higher than others, or a game bot may try to imitate a normal player to avoid being detected. Many machine learning methods [1, 2, 4–8] were developed to detect game bot attacks based on behavioral features. General machine learning methods are to collect data from games’ database first, and then, features will be extracted. These features are standardized to speed up the training process. After standardizing, all data are going to be separated into the training data and testing data. And the training data will be trained by some machine learning algorithms to build various models. Although these machine learning models can be used to exactly detect more definite game bot players, some players belonging to the gray area cannot be detected accurately. The existing works do not discuss the gray area of abnormal rate. These existing works use 50% to separate the normal and abnormal rates, but clusters of these two rates may overlap. So, the gray area is the cluster of detection rates between normal and abnormal rates. This work uses K means to generate the gray area cluster automatically. The rates in the gray area potentially result in most false positives and negatives. Therefore, this work will deal with these false positives and negatives in the gray area in order to increase detection accuracy.The distribution of abnormal rates can be the clusters of high and low to predict the game bot and normal players. However, these two clusters can overlap to form a gray area such that we cannot use 50% to separate them easily. So, we need to find out those abnormal rates nearby 50%, and these rates form the gray area. Then, we can deal with these challenging rates that cause false positives and negatives. However, we require a method to find out these rates automatically instead of setting the manual border. Therefore, we adopt theK-means clustering to find out the gray area by setting K = 3 to cluster the rates into the normal, gray area, and abnormal clusters to generate the gray area cluster automatically. Most deep learning-based intrusion detection models do not identify and deal with the gray area directly.In this study, we propose the multilayer perceptron (MLP) neural networks to effectively detect game bots, particularly in the gray area. As a neural network is a black-box model, it is extremely difficult for bot developers to recognize detection thresholds for neutralizing detection methods. In this study, we train the proposed deep neural network models on the famous mobile online baseball game named KANO. We find that the random forest algorithm is more frequently used in machine learning and thus choose it to compare with the proposed approach in experimental evaluation. In the experiments, we design and train four MLP models which have different optimizers, epochs, split of validation, and batch size, and we will choose the best model among them as the baseline of deep learning. We also employ the mobile online game players’ dataset to train the machine learning’s random forest model. According to the experimental results, the proposed best model increases the accuracy from 95.2% to 99.894% and reduces the error rate from 4.8% to 0.106%, as compared with the random forest model in the same players’ dataset. Also, the proposed approach has lower FNR (False Negative Rate) and FPR (False Positive Rate) and therefore achieves better performance on detecting the gray area.The key contributions of the study are that this paper adoptsK means to generate the gray area cluster of abnormal rates automatically. These rates can result in false positives and negatives because they are nearby the 50% rate. By generating the gray area cluster, we can deal with these rates to adjust the best border to distinguish the normal and abnormal players and increase the detection accuracy. Moreover, the novelty of this work is that this work identifies the gray area by clustering the abnormal rates based on K means. The root cause of false positives and negatives comes from the gray area. Therefore, this study deals with the abnormal rate in the gray area to resolve the false positives and negatives and increase the accuracy.The remainder of this study is organized as follows. In Section2, the related work will be surveyed. Section 3 proposes the system model and detection approach based on the deep neural networks, including players’ data feature extraction and transformation, the architecture for MLP neural networks, and gray area prediction and response. Section 4 conducts the experiments on the dataset of the mobile online game and further compares it with the random forest method in machine learning. Finally, some concluding remarks are presented in Section 5.


## 2. Related Works

### 2.1. Game Bot Attacks and Countermeasures

With the popularity of mobile online games, game bots have become a critical security issue that must be solved effectively. The behavior of using bots will break the fairness of the whole game and lead to the fact that normal players quit the game. For a normal player, his/her game score should grow slowly after he/she practices continuously. If the player suddenly increases many scores within a short period of time, he/she may be abnormal by using game bots. Based on the principle of using a game bot and the degree of endangering games, game bots are classified into three types: auxiliary, modification, and crack [1–3, 9]. The auxiliary type of game bot imitates the human’s pressing button actions, automatically doing some repetitive operations. The modification type of game bot uses the third-party mobile application to inject a malicious module into the game and then modify the game’s internal data. This type of game bot seriously breaks the fairness of the game. Finally, the crack type of game bot has the most influence on game vendors; it not only breaks the game’s fairness but also accelerates a game to be on the decline. This type of game bot has entirely known about the game and can unscrupulously modify the game’s code.The ways of defending game bots are based on three directions [3, 8, 10]. The first solution is the client side’s defense by using a mobile application, protecting the game’s code from being modified to reduce the possibility of trying to crack the game. However, this method excessively drops users’ game experience, as they feel disturbed during the play. Second, the information transmitted between a client and the server is encrypted to prevent game bots from eavesdropping. This solution must spend more computation time to encrypt/decrypt the transmitted information. The third method for defeating game bots is back-end protection by timely monitoring or offline data analysis to defend known or unknown game bots. However, the previously proposed models performed well in the selected game, but are hard to be utilized in other games. In addition, bot developers can neutralize detection methods if they recognize detection thresholds. Once bot developers figure out patterns of bot detection, they start to generate bots to imitate human users’ behaviors [2]. For securing bot detection, it is necessary to develop an improved method, particularly in the gray area that cannot be detected accurately.


### 2.2. Game Bot Detection Based on Behavioral Features

Behavioral actions depict how a character performs physical activities such as moving, normal attack, or using skills [2]. Lee et al. [9] analyzed the full action sequence of players on a big data platform. Their approach was to set specific behavior sequences and apply the scoring algorithm and Naïve Bayesian algorithm to classify bots from players. In another method, Lee et al. [1] captured the similarity of character behavior to classify game bots. This method was to divide behavior sequences with a time window and embedded as a feature vector. Bots were shown they have similar behavior patterns during playtime by applying the logistic regression algorithm with self-similarity of characters. The aforementioned two methods [1, 9] demonstrated significant performance but had no sustainability. If bot developers change patterns of game bots, their detection methods are easily avoidable.A lot of machine learning algorithms were applied to game bot defense. The most frequently used algorithms included J48, DecisionStump, HoeffdingTree, RandomForest, and REPTree [5, 11, 12]. A machine learning method is to collect data from games’ databases first, and then, features will be extracted [13]. These features are standardized to speed up the training process. After standardizing, all data are going to be separated into training data and testing data. And the training data will be trained by some machine learning algorithms and built a model which is used to identify whether a player is a bot. Bernardi et al. [6] used many machine learning algorithms to detect game bots through behavioral features. They were first based on descriptive statistics to see what is the difference between a human and a bot and then utilized many machine learning algorithms to find the best algorithm that can accurately detect game bots. Kang et al. [4] detected multimodal game bots through user behavioral characteristics. They also first collected data from the game’s database and then extracted users’ features. They used four different machine learning algorithms to evaluate many metrics, including accuracy, precision, recall, and F-measure. Tao et al. [10] proposed a generalized game bot detection framework for massively multiplayer online role-playing games (MMORPGs) termed NGUARD, denoting NetEase Games’ Guard. NGUARD took charge of automatically differentiating game bots from humans for MMORPGs. Xu et al. [8] employed a combination of supervised and unsupervised methods for game bot detection, where supervised methods were applied to discriminating bots and humans according to labeled data, and unsupervised methods were also applied to detecting game bots and can further help discover a new type of game bots. Park et al. [14] indicated one problem with the detection methodologies is that they do not provide rational explanations about their decisions. To resolve this problem, Park et al. [14] investigated the explainabilities of the game bot detection. They developed the XAI (Explainable Artificial Intelligence) model using a dataset from the Korean MMORPG, AION, which includes game logs of human players and game bots. Table 1 summarises the related works.Table 1
Comparison of the related works.
AuthorYearDatasetApproachKang et al. [3]2013AIONRule setChung et al. [7]2013Yulgang onlineMultiple SVM (support vector machine)Lee et al. [1]2016Lineage, AION, blade & soulLogistic regressionTao et al. [10]2018NetEase MMORPGsABLSTM (attention-based bidirectional long short-term memory network)Park et al. [2]2019AIONLSTM (long short-term memory network)Xu et al. [8]2020NetEase MMORPGsCombination of supervised and unsupervised methodsPark et al. [14]2021AIONXAI (explainable artificial intelligence) modelThe learning models mentioned above can be used to exactly detect more definite game bot players. However, some players belonging to the gray area cannot be detected accurately. Hence, developing an improved method for effectively detecting game bots is exceedingly essential.


## 2.1. Game Bot Attacks and Countermeasures

With the popularity of mobile online games, game bots have become a critical security issue that must be solved effectively. The behavior of using bots will break the fairness of the whole game and lead to the fact that normal players quit the game. For a normal player, his/her game score should grow slowly after he/she practices continuously. If the player suddenly increases many scores within a short period of time, he/she may be abnormal by using game bots. Based on the principle of using a game bot and the degree of endangering games, game bots are classified into three types: auxiliary, modification, and crack [1–3, 9]. The auxiliary type of game bot imitates the human’s pressing button actions, automatically doing some repetitive operations. The modification type of game bot uses the third-party mobile application to inject a malicious module into the game and then modify the game’s internal data. This type of game bot seriously breaks the fairness of the game. Finally, the crack type of game bot has the most influence on game vendors; it not only breaks the game’s fairness but also accelerates a game to be on the decline. This type of game bot has entirely known about the game and can unscrupulously modify the game’s code.The ways of defending game bots are based on three directions [3, 8, 10]. The first solution is the client side’s defense by using a mobile application, protecting the game’s code from being modified to reduce the possibility of trying to crack the game. However, this method excessively drops users’ game experience, as they feel disturbed during the play. Second, the information transmitted between a client and the server is encrypted to prevent game bots from eavesdropping. This solution must spend more computation time to encrypt/decrypt the transmitted information. The third method for defeating game bots is back-end protection by timely monitoring or offline data analysis to defend known or unknown game bots. However, the previously proposed models performed well in the selected game, but are hard to be utilized in other games. In addition, bot developers can neutralize detection methods if they recognize detection thresholds. Once bot developers figure out patterns of bot detection, they start to generate bots to imitate human users’ behaviors [2]. For securing bot detection, it is necessary to develop an improved method, particularly in the gray area that cannot be detected accurately.


## 2.2. Game Bot Detection Based on Behavioral Features

Behavioral actions depict how a character performs physical activities such as moving, normal attack, or using skills [2]. Lee et al. [9] analyzed the full action sequence of players on a big data platform. Their approach was to set specific behavior sequences and apply the scoring algorithm and Naïve Bayesian algorithm to classify bots from players. In another method, Lee et al. [1] captured the similarity of character behavior to classify game bots. This method was to divide behavior sequences with a time window and embedded as a feature vector. Bots were shown they have similar behavior patterns during playtime by applying the logistic regression algorithm with self-similarity of characters. The aforementioned two methods [1, 9] demonstrated significant performance but had no sustainability. If bot developers change patterns of game bots, their detection methods are easily avoidable.A lot of machine learning algorithms were applied to game bot defense. The most frequently used algorithms included J48, DecisionStump, HoeffdingTree, RandomForest, and REPTree [5, 11, 12]. A machine learning method is to collect data from games’ databases first, and then, features will be extracted [13]. These features are standardized to speed up the training process. After standardizing, all data are going to be separated into training data and testing data. And the training data will be trained by some machine learning algorithms and built a model which is used to identify whether a player is a bot. Bernardi et al. [6] used many machine learning algorithms to detect game bots through behavioral features. They were first based on descriptive statistics to see what is the difference between a human and a bot and then utilized many machine learning algorithms to find the best algorithm that can accurately detect game bots. Kang et al. [4] detected multimodal game bots through user behavioral characteristics. They also first collected data from the game’s database and then extracted users’ features. They used four different machine learning algorithms to evaluate many metrics, including accuracy, precision, recall, and F-measure. Tao et al. [10] proposed a generalized game bot detection framework for massively multiplayer online role-playing games (MMORPGs) termed NGUARD, denoting NetEase Games’ Guard. NGUARD took charge of automatically differentiating game bots from humans for MMORPGs. Xu et al. [8] employed a combination of supervised and unsupervised methods for game bot detection, where supervised methods were applied to discriminating bots and humans according to labeled data, and unsupervised methods were also applied to detecting game bots and can further help discover a new type of game bots. Park et al. [14] indicated one problem with the detection methodologies is that they do not provide rational explanations about their decisions. To resolve this problem, Park et al. [14] investigated the explainabilities of the game bot detection. They developed the XAI (Explainable Artificial Intelligence) model using a dataset from the Korean MMORPG, AION, which includes game logs of human players and game bots. Table 1 summarises the related works.Table 1
Comparison of the related works.
AuthorYearDatasetApproachKang et al. [3]2013AIONRule setChung et al. [7]2013Yulgang onlineMultiple SVM (support vector machine)Lee et al. [1]2016Lineage, AION, blade & soulLogistic regressionTao et al. [10]2018NetEase MMORPGsABLSTM (attention-based bidirectional long short-term memory network)Park et al. [2]2019AIONLSTM (long short-term memory network)Xu et al. [8]2020NetEase MMORPGsCombination of supervised and unsupervised methodsPark et al. [14]2021AIONXAI (explainable artificial intelligence) modelThe learning models mentioned above can be used to exactly detect more definite game bot players. However, some players belonging to the gray area cannot be detected accurately. Hence, developing an improved method for effectively detecting game bots is exceedingly essential.


## 3. The Proposed Deep Neural Networks-Based Approach

### 3.1. System Model

In this study, we focus on players who use bots to modify internal data. In the game bot detection, it is hard to detect gray area players because normal or abnormal players’ data look like each other in the gray area and thus reduce the accuracy of the detection system. Besides, the detection system needs more and more players’ data to detect game bots; otherwise, it will only increase the false detection. This suggests the importance of players’ historical data in the game detection system. Little players’ data cannot increase the accuracy of the detection system.Most back-end game bot detection approaches are to use players’ data, such as players’ levels or their experience values. They collect and preprocess these data from the game’s database. Then, these preprocessed data will be used in machine learning or data mining to build a model or define the range. If there are new players’ data that need to be detected, they can use the previously defined range to judge whether is normal or not. Different from the general approach, we use the deep learning technique [15] to build the model and utilize this model to analyze the players in the famous game named KANO which is a mobile online game of playing baseball. Figure 1 illustrates the overall architecture of the proposed game bot detection.Figure 1
The system model of the proposed game bot detection.We devise the deep learning approach to detect game bots and gray area players based on the multiplayer perceptron (MLP) neural networks [16, 17]. MLP is a class of feedforward artificial neural networks and a universal function approximator [18]. It can be used to create a mathematical model by regression analysis. MLP has broad application situations in diverse fields such as image recognition, speech recognition, and machine translation. The proposed deep neural networks-based approach utilizes a dataset of players’ historical data. The raw data are preprocessed first, including data transformation, feature extraction, and standardization, to get better data formats for model learning. Then, the preprocessed data are fed into a neural network to build a model, where we must decide how many layers and neural units the model possesses. Then, we must set each neural layer’s initialization function and activation function. Finally, we set the whole model’s loss function, optimizer, and metrics. After setting the model, we can build the model, calculate each player’s abnormal rate, cluster players based on their abnormal rate, and finally define the gray area. When there are new players whose data have been updated, the system preprocesses the raw data first and joins the players’ data into the historical dataset afterward. Next, the trained model is used to predict and calculate the abnormal rate. We distinguish players into three types: normal, abnormal, and blurred player based on their abnormal rate. We present four MLP models in this study. They consist of different parameters and settings, such as kernel initialization, activation function, and epoch.


### 3.2. Players’ Feature Extraction and Transformation

We first export players’ data to a csv file named “Players.csv” from the mobile online game’s database. Because we use Python to deal with the data, we choose the needed columns and transform these selected columns’ data to Pandas data frame format so that we can handle the data easily. We use these fields as the training features. Table2 shows the descriptions and names of these fields. After processing, we remove the name’s column temporarily because names will not be used in the training phase and are going to be used in the prediction phase. Then, we check if there is any field being the null value and transform all data frames to arrays.Table 2
Descriptions and names of player data’s 9 fields.
NameDescriptionGoldThe number of gold that a player holdsGold levelThe level of the number of holding goldPlayer levelPlayer level is to depend on experiencePlayer experiencePlayer’s experienceNumber of playersThe coach can set the number of players in the gamePlayer status0: idle; 1: playingEnduranceEndurance of a playerFightingFighting of a playerReputationThe reputation of a playerAfter transformation, we get an×m matrix, which is n rows and m columns, and this is a tuple of integers indicating the size of the array in each dimension. Then, we extract the label and features from the array. Next, we are going to do standardizing because every numerical characteristic field has a different unit; for example, the unit of some players is person, and gold level’s unit is level and does not have a common standard. Let all values be between 0 and 1 by standardization. Standardization can raise the accuracy of the model after training. Finally, we randomly separate the processed data into training and testing data, where training and testing data are 80% and 20% of all processed data, respectively. Here, training data are used for training a model, and testing data are used for calculating the accuracy of finishing model training.


### 3.3. Multilayer Perceptron Neural Network Model

In this section, we design a multilayer perceptron (MLP) neural network model. MLP consists of at least one hidden layer (not including input and output layers), and it can learn not only linear function but also nonlinear function. We use backpropagation to train the model, which is a method used in an artificial neural network. Backpropagation calculates a gradient that is needed in the calculation of the weights, and it is a supervised learning method. In brief, backpropagation is just like “learning from mistakes,” and it can help adjust the optimum weights.For MLP, the multilayer network can get better convergence, but too many hidden layers just let network complexity be bigger, making more local minimum points. Cybenko [19] had proved that, in the case of a hidden layer having enough neural units, only one hidden layer can approach any continuous function. Hush and Horne [20] also presented that a neural network using two hidden layers, each layer just possessing a few neural units, can replace the neural network that uses one hidden layer and a lot of neural units. Eventually, it depends on how complex the problem is. In this study, we set the MLP as a 2-layer architecture, one input layer, two hidden layers, and one output layer [21, 22].As for the number of neural units of the hidden layer, too few neural units may make large errors. On the contrary, although a big number of neural units can reduce deviation values, the convergence rate will slow down. Even after more than a certain number, it will increase the time of training a neural network. Taud and Mas [23] pointed out that too many neural units in the neural network generate the phenomenon of overfitting. Overfitting means overtraining; that is, the hypothesis of machine learning is too close to the training data, making the error larger when the hypothesis is going to match the testing data. Dawson and Wilby [24] presented two ways to decide the number of neural units: pruning algorithm and constructive algorithm. The pruning algorithm is a technique in machine learning. It first sets a huge number of neural units of the hidden layer to start training and then reduces the number of neural units one by one. On the contrary, a constructive algorithm sets a small number of neural units first and then adds the number of network units one by one. Because the previous processed features have 9 fields, we set the input layer as 9 neural units and concatenate the output to the hidden layer 1. The hidden layer 1 adopts a constructive algorithm and sets 20 neural units first. Finally, we find that 50 neural units possess the best effect. After we finish setting the number of neural units, we then set the initialization function. Because the essence of the training procedure of the deep learning model is to update the weight, this process requires every parameter to have its corresponding initial value, and the initialization function has a great impact on model convergence. Thus, we must set the initialization function. We set the initialization function of the hidden layer 1 as uniform distribution to initialize weight and bias:(1)fx=1b−aa≤x≤b,0,otherwise.Here, random variablex is restricted to a finite interval [a, b]. The activation function’s main effect is to broach the nonlinearity. In the artificial neural network, if we do not use the activation function, the linear combination of the front layer input is the output of this layer (input and output still keep a linear relationship), which makes the deep artificial neural network becomes meaningless. So, we set the activation function as rectified linear units (ReLu function):(2)fx=ReLux=max0,x,where x is the input to a neuron. Compared with traditional neural network activation functions, e.g., tanh and ReLu function has more advantages. ReLu function has more efficient gradient propagation, avoiding vanishing or exploding gradient problems.Next is the hidden layer 2 which adopts the pruning algorithm. We first set 50 neural units and then find 40 neural units that have the best effect. And its initialization function and activation function are the same as hidden layer 1 [25]. In addition, because we are going to predict abnormal rates afterward, the output layer has 1 neural unit, and we set its activation function as the Sigmoid function:(3)St=11+e−t,where t is an independent variable and S(t) is an exponential function. The output of the sigmoid function can range from 0 to 1.When all functions have finished their set, we can build a sequential stack model. Figure2 illustrates the overall MLP neural networks architecture. Before training, we have to define the training method. We first set the loss function which is used to estimate the model’s discordant degree of prediction and real value. The smaller the loss function is, the greater the model’s robustness is. Because the problem is binary classification, we set it as binary cross-entropy (log loss), using logistic regression, to get the following formula:(4)−1N∑i=1Nyilogy^i+1−yilog1−y^i.Figure 2
The proposed MLP neural networks.It utilizes a known sample distribution to find the parameter values that are most likely to cause this distribution (that is maximum probability). In deep learning, it is useful to use cross-entropy to obtain a better training effect. And it is common to optimize the gradient; that is, an optimizer is used to optimize every gradient descent algorithm. We set optimizer as adaptive moment estimation (Adam) function:(5)θt+1=θt−ηυ^t+ε.Adam optimizer is a first-order optimization algorithm that can replace the traditional random gradient descent process. It is based on training data iteration to update neural network weights. Using Adam optimizer, it can make training convergence quicker and raise the accuracy. The final parameter is the metric function. Metric is a norm of evaluating neural network performance and does not participate in the optimization process. The model is binary classification, so it usually sets the metric as an accuracy function.Regarding the computational complexity of the proposed MLP model, we will describe it in the following. As shown in Figure2, we define the number of neural units in the input layer, hidden layer 1, hidden layer 2, and output layer as Ni, N1, N2, and No, respectively. Because the major computational complexity in MLP involves the fully connected networks between the layers, the computational complexity is Ni∗N1+N1∗N2+N2∗No [26].


### 3.4. Predicting Gray Area and Response

When we have finished training the model, we can further use this model to predict whether is a game bot. We write the previous data preprocessing method to a function so that when there is new or updated data needing to be detected, we can use this function to preprocess the raw data first. Then, we use the trained model to predict, and the prediction will calculate the abnormal rate to know whether a player is normal or not.Although a player can be judged based on his/her abnormal rate, there is still some misjudgment in the gray area. In this study, the gray area means a normal player data looking abnormal or an abnormal player whose data looks normal. These two types of players make judgment go wrong easily, and therefore, we must devise a method to detect the gray area player for effectively identifying game bots.We adopt theK-means clustering method [27] to cluster players based on their abnormal rates. For the abnormal rates, we want to separate them into three clusters: normal, gray area, and game bot. K means can find the best clusters with center points having minimal distances to the group members and automatically calculate the border of the cluster without manual thresholding. By K means, we can easily find out the gray area cluster between normal and game bot clusters. The rates in the gray area cluster are far away from the center points of normal and game bot clusters, so K means can help us to determine the best size of the gray area cluster and its border. The K-means clustering was presented by Hartigan and Wong [27], which is a method of vector quantization, originally from signal processing. It aims to partition n observation into K clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster. Through a set of observations, the general procedure is to search for a K-partition with a locally optimal within-cluster sum of squares by moving points from one cluster to another, and the following is the formula:(6)argminS∑i=1k∑x∈Six−μi2.After clustering, we obtain three clusters, including normal, gray area, and game bot clusters. To exactly define whether a player in the gray area is normal, we check each player’s data to see if there is a misjudgment. Finally, we get a range to judge the player and then evaluate whether the proposed model is accurate and further compare with the random forest model in machine learning by using the following metrics [28, 29]: error rate, accuracy, precision, recall, F1 score, false-positive rate (FPR), and false-negative rate (FNR), where FN, FP, TN, and TP denote the number of false negatives, false positives, true negatives, and true positives, respectively:(7)Error rate=FN+FPFN+FP+TN+TP×100%,Accuracy=TN+TPFN+FP+TN+TP×100%,Precision=TPTP+FP×100%,Recall=TPTP+FN×100%,F1score=2∗Precision∗RecallPrecision+Recall×100%,FPR=FPFP+TN×100%,FNR=FNFN+TP×100%.


## 3.1. System Model

In this study, we focus on players who use bots to modify internal data. In the game bot detection, it is hard to detect gray area players because normal or abnormal players’ data look like each other in the gray area and thus reduce the accuracy of the detection system. Besides, the detection system needs more and more players’ data to detect game bots; otherwise, it will only increase the false detection. This suggests the importance of players’ historical data in the game detection system. Little players’ data cannot increase the accuracy of the detection system.Most back-end game bot detection approaches are to use players’ data, such as players’ levels or their experience values. They collect and preprocess these data from the game’s database. Then, these preprocessed data will be used in machine learning or data mining to build a model or define the range. If there are new players’ data that need to be detected, they can use the previously defined range to judge whether is normal or not. Different from the general approach, we use the deep learning technique [15] to build the model and utilize this model to analyze the players in the famous game named KANO which is a mobile online game of playing baseball. Figure 1 illustrates the overall architecture of the proposed game bot detection.Figure 1
The system model of the proposed game bot detection.We devise the deep learning approach to detect game bots and gray area players based on the multiplayer perceptron (MLP) neural networks [16, 17]. MLP is a class of feedforward artificial neural networks and a universal function approximator [18]. It can be used to create a mathematical model by regression analysis. MLP has broad application situations in diverse fields such as image recognition, speech recognition, and machine translation. The proposed deep neural networks-based approach utilizes a dataset of players’ historical data. The raw data are preprocessed first, including data transformation, feature extraction, and standardization, to get better data formats for model learning. Then, the preprocessed data are fed into a neural network to build a model, where we must decide how many layers and neural units the model possesses. Then, we must set each neural layer’s initialization function and activation function. Finally, we set the whole model’s loss function, optimizer, and metrics. After setting the model, we can build the model, calculate each player’s abnormal rate, cluster players based on their abnormal rate, and finally define the gray area. When there are new players whose data have been updated, the system preprocesses the raw data first and joins the players’ data into the historical dataset afterward. Next, the trained model is used to predict and calculate the abnormal rate. We distinguish players into three types: normal, abnormal, and blurred player based on their abnormal rate. We present four MLP models in this study. They consist of different parameters and settings, such as kernel initialization, activation function, and epoch.


## 3.2. Players’ Feature Extraction and Transformation

We first export players’ data to a csv file named “Players.csv” from the mobile online game’s database. Because we use Python to deal with the data, we choose the needed columns and transform these selected columns’ data to Pandas data frame format so that we can handle the data easily. We use these fields as the training features. Table2 shows the descriptions and names of these fields. After processing, we remove the name’s column temporarily because names will not be used in the training phase and are going to be used in the prediction phase. Then, we check if there is any field being the null value and transform all data frames to arrays.Table 2
Descriptions and names of player data’s 9 fields.
NameDescriptionGoldThe number of gold that a player holdsGold levelThe level of the number of holding goldPlayer levelPlayer level is to depend on experiencePlayer experiencePlayer’s experienceNumber of playersThe coach can set the number of players in the gamePlayer status0: idle; 1: playingEnduranceEndurance of a playerFightingFighting of a playerReputationThe reputation of a playerAfter transformation, we get an×m matrix, which is n rows and m columns, and this is a tuple of integers indicating the size of the array in each dimension. Then, we extract the label and features from the array. Next, we are going to do standardizing because every numerical characteristic field has a different unit; for example, the unit of some players is person, and gold level’s unit is level and does not have a common standard. Let all values be between 0 and 1 by standardization. Standardization can raise the accuracy of the model after training. Finally, we randomly separate the processed data into training and testing data, where training and testing data are 80% and 20% of all processed data, respectively. Here, training data are used for training a model, and testing data are used for calculating the accuracy of finishing model training.


## 3.3. Multilayer Perceptron Neural Network Model

In this section, we design a multilayer perceptron (MLP) neural network model. MLP consists of at least one hidden layer (not including input and output layers), and it can learn not only linear function but also nonlinear function. We use backpropagation to train the model, which is a method used in an artificial neural network. Backpropagation calculates a gradient that is needed in the calculation of the weights, and it is a supervised learning method. In brief, backpropagation is just like “learning from mistakes,” and it can help adjust the optimum weights.For MLP, the multilayer network can get better convergence, but too many hidden layers just let network complexity be bigger, making more local minimum points. Cybenko [19] had proved that, in the case of a hidden layer having enough neural units, only one hidden layer can approach any continuous function. Hush and Horne [20] also presented that a neural network using two hidden layers, each layer just possessing a few neural units, can replace the neural network that uses one hidden layer and a lot of neural units. Eventually, it depends on how complex the problem is. In this study, we set the MLP as a 2-layer architecture, one input layer, two hidden layers, and one output layer [21, 22].As for the number of neural units of the hidden layer, too few neural units may make large errors. On the contrary, although a big number of neural units can reduce deviation values, the convergence rate will slow down. Even after more than a certain number, it will increase the time of training a neural network. Taud and Mas [23] pointed out that too many neural units in the neural network generate the phenomenon of overfitting. Overfitting means overtraining; that is, the hypothesis of machine learning is too close to the training data, making the error larger when the hypothesis is going to match the testing data. Dawson and Wilby [24] presented two ways to decide the number of neural units: pruning algorithm and constructive algorithm. The pruning algorithm is a technique in machine learning. It first sets a huge number of neural units of the hidden layer to start training and then reduces the number of neural units one by one. On the contrary, a constructive algorithm sets a small number of neural units first and then adds the number of network units one by one. Because the previous processed features have 9 fields, we set the input layer as 9 neural units and concatenate the output to the hidden layer 1. The hidden layer 1 adopts a constructive algorithm and sets 20 neural units first. Finally, we find that 50 neural units possess the best effect. After we finish setting the number of neural units, we then set the initialization function. Because the essence of the training procedure of the deep learning model is to update the weight, this process requires every parameter to have its corresponding initial value, and the initialization function has a great impact on model convergence. Thus, we must set the initialization function. We set the initialization function of the hidden layer 1 as uniform distribution to initialize weight and bias:(1)fx=1b−aa≤x≤b,0,otherwise.Here, random variablex is restricted to a finite interval [a, b]. The activation function’s main effect is to broach the nonlinearity. In the artificial neural network, if we do not use the activation function, the linear combination of the front layer input is the output of this layer (input and output still keep a linear relationship), which makes the deep artificial neural network becomes meaningless. So, we set the activation function as rectified linear units (ReLu function):(2)fx=ReLux=max0,x,where x is the input to a neuron. Compared with traditional neural network activation functions, e.g., tanh and ReLu function has more advantages. ReLu function has more efficient gradient propagation, avoiding vanishing or exploding gradient problems.Next is the hidden layer 2 which adopts the pruning algorithm. We first set 50 neural units and then find 40 neural units that have the best effect. And its initialization function and activation function are the same as hidden layer 1 [25]. In addition, because we are going to predict abnormal rates afterward, the output layer has 1 neural unit, and we set its activation function as the Sigmoid function:(3)St=11+e−t,where t is an independent variable and S(t) is an exponential function. The output of the sigmoid function can range from 0 to 1.When all functions have finished their set, we can build a sequential stack model. Figure2 illustrates the overall MLP neural networks architecture. Before training, we have to define the training method. We first set the loss function which is used to estimate the model’s discordant degree of prediction and real value. The smaller the loss function is, the greater the model’s robustness is. Because the problem is binary classification, we set it as binary cross-entropy (log loss), using logistic regression, to get the following formula:(4)−1N∑i=1Nyilogy^i+1−yilog1−y^i.Figure 2
The proposed MLP neural networks.It utilizes a known sample distribution to find the parameter values that are most likely to cause this distribution (that is maximum probability). In deep learning, it is useful to use cross-entropy to obtain a better training effect. And it is common to optimize the gradient; that is, an optimizer is used to optimize every gradient descent algorithm. We set optimizer as adaptive moment estimation (Adam) function:(5)θt+1=θt−ηυ^t+ε.Adam optimizer is a first-order optimization algorithm that can replace the traditional random gradient descent process. It is based on training data iteration to update neural network weights. Using Adam optimizer, it can make training convergence quicker and raise the accuracy. The final parameter is the metric function. Metric is a norm of evaluating neural network performance and does not participate in the optimization process. The model is binary classification, so it usually sets the metric as an accuracy function.Regarding the computational complexity of the proposed MLP model, we will describe it in the following. As shown in Figure2, we define the number of neural units in the input layer, hidden layer 1, hidden layer 2, and output layer as Ni, N1, N2, and No, respectively. Because the major computational complexity in MLP involves the fully connected networks between the layers, the computational complexity is Ni∗N1+N1∗N2+N2∗No [26].


## 3.4. Predicting Gray Area and Response

When we have finished training the model, we can further use this model to predict whether is a game bot. We write the previous data preprocessing method to a function so that when there is new or updated data needing to be detected, we can use this function to preprocess the raw data first. Then, we use the trained model to predict, and the prediction will calculate the abnormal rate to know whether a player is normal or not.Although a player can be judged based on his/her abnormal rate, there is still some misjudgment in the gray area. In this study, the gray area means a normal player data looking abnormal or an abnormal player whose data looks normal. These two types of players make judgment go wrong easily, and therefore, we must devise a method to detect the gray area player for effectively identifying game bots.We adopt theK-means clustering method [27] to cluster players based on their abnormal rates. For the abnormal rates, we want to separate them into three clusters: normal, gray area, and game bot. K means can find the best clusters with center points having minimal distances to the group members and automatically calculate the border of the cluster without manual thresholding. By K means, we can easily find out the gray area cluster between normal and game bot clusters. The rates in the gray area cluster are far away from the center points of normal and game bot clusters, so K means can help us to determine the best size of the gray area cluster and its border. The K-means clustering was presented by Hartigan and Wong [27], which is a method of vector quantization, originally from signal processing. It aims to partition n observation into K clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster. Through a set of observations, the general procedure is to search for a K-partition with a locally optimal within-cluster sum of squares by moving points from one cluster to another, and the following is the formula:(6)argminS∑i=1k∑x∈Six−μi2.After clustering, we obtain three clusters, including normal, gray area, and game bot clusters. To exactly define whether a player in the gray area is normal, we check each player’s data to see if there is a misjudgment. Finally, we get a range to judge the player and then evaluate whether the proposed model is accurate and further compare with the random forest model in machine learning by using the following metrics [28, 29]: error rate, accuracy, precision, recall, F1 score, false-positive rate (FPR), and false-negative rate (FNR), where FN, FP, TN, and TP denote the number of false negatives, false positives, true negatives, and true positives, respectively:(7)Error rate=FN+FPFN+FP+TN+TP×100%,Accuracy=TN+TPFN+FP+TN+TP×100%,Precision=TPTP+FP×100%,Recall=TPTP+FN×100%,F1score=2∗Precision∗RecallPrecision+Recall×100%,FPR=FPFP+TN×100%,FNR=FNFN+TP×100%.


## 4. Experimental Evaluation

### 4.1. Dataset Description and Preprocessing

We evaluate the proposed bot detection in the mobile online KANO game’s dataset. The dataset recorded the players’ data from 2019 to 2021, including normal and abnormal behaviors. We extract these three years’ player data which comprise about 210,000 players (130,000 normal and 80,000 abnormal players).The dataset also contains labels that are used to mark whether a player is normal. Labels are either 0 or 1, which means a human and a bot, respectively. Because enough data can make detection more accurate, all 210,000 data are used to train the model. The data preprocessing function is used to process the raw data, and then, the proposed MLP model will be built.


### 4.2. Experimental Setting and Results

In this section, we present the experimental results acquired from different MLP neural network models and a widely used random forest machine learning model with the same dataset. The training model environment is on NVIDIA GTX 1050Ti GPUs with 4 GB memory.We set training parameters to separate the dataset into training and testing data with different ratios, where different ratios will have different results. As discussed in Section3, Table 3 describes the specifications of models used in experiments. To simplify the expression, we name each model with a different name listed in Table 3 to explain the experimental results.Table 3
Specifications of different MLP models.
ItemsModel_1Model_2Model_3Model_4Layer2222Neuron50, 4050, 4050, 4050, 40Activation functionReLu, sigmodReLu, sigmodReLu, sigmoidReLu, sigmoidLoss functionBinary cross-entropyBinary cross-entropyBinary cross-entropyBinary cross-entropyOptimizerAdamAdadeltaAdamaxNadamSplit of validation0.10.30.20.4Epochs30201215Batch_size1000500095007000We contrast among different MLP models to choose the best model by estimating the results with the same dataset. We also contrast between the MLP model and random forest algorithm. The random forest algorithm was developed by Breiman [30], which has many merits, e.g., being able to process large input variables, and is extensively used in machine learning. Accordingly, we select the random forest method as the baseline of the general machine learning model in the experiments. We evaluate the experimental results using five metrics, including the error rate, accuracy, precision, recall, and F1 score. In the following, we first list the comparisons among the proposed four MLP neural network models, then conduct the comparisons between the random forest machine learning and the proposed best MLP neural network from the same KANO game players’ dataset, and further make comparisons between Park et al.’s method [14] and the proposed best MLP model.


#### 4.2.1. Comparisons among the Proposed Four MLP Models

We compare the performance of four different MLP neural network models with the same amount of data in this experiment. The differences among the four models are the optimizer, split of validation, epochs, and batch size. To strengthen the accuracy or reduce the error rate, we will increase the number of epochs and use more times of training periods to improve them. However, it still needs to consider other variables, including a split of validation or batch size; if we do not consider these variables, it may increase the training time, decrease the accuracy, and therefore raise the error rate. Table4 demonstrates the results of the performance comparisons among these four different MLP models. We find that these four MLP neural network models reach a similar performance in the experimental results. Especially, model_3 has the best accuracy, precision, recall, F1 score, and the most reduced error rate. The accuracy in model_3 is extremely high, 99.894%. The F1 score is the combination of precision and recall. Unlike accuracy, F1 does not involve TN, true normal users, which are usually more than true abnormal users. F1 in model_3 is also very high, 96.163%. Precision shows the influences of FP against TP, and recall reflects FN. Both of them in model_3 are the best, and recall is relatively higher than precision. So, model_3 can provide extremely low FP, which is more critical than FN due to the large among of normal users, and still provide very low FN to detect abnormal users.Table 4
Performance comparisons among different MLP models.
MetricsModel_1Model_2Model_3Model_4Error rate3.818%1.382%0.106%1.659%Accuracy96.182%98.618%99.894%98.341%Precision96.58%97.013%97.352%97.116%Recall98.057%97.219%99.319%98.127%F1 score96.123%96.142%96.163%96.125%Total training time (second)22 s16 s1 s7 sMoreover, Figures3 and 4 separately illustrate accuracy and loss for training iterations of model_3 in the experiment. Chollet [31] indicated that if a proposed model has a large gap between its training error curve and validation error curve, it shows the proposed model may have a big problem of overfitting. In the experimental result of model_3, the gaps between the training and validation sets in accuracy and loss are both very small, which means there is not too much phenomenon of overfitting or underfitting in the training iterations.Figure 3
Accuracy for training iterations of model_3.Figure 4
Loss for training iterations of model_3.


#### 4.2.2. Comparisons between the Random Forest Machine Learning and Proposed Best MLP Model from the Same KANO Game Players’ Dataset

Here, we contrast the performance of the MLP neural network and random forest models. In the next section, we will compare the performance of detecting the gray area between the two models. Based on the above analysis, we select model_3 as the representative of various MLP neural networks and compare it with the random forest method. Table5 shows the contrast between model_3 and the random forest model with the same dataset. The contrast result shows that the best model_3 achieves the error rate of 0.106%, accuracy of 99.894%, and F1 score of 99.163%, while the random forest model (with the same dataset) achieves the error rate of 4.8%, accuracy of 95.2%, and F1 score of 95.0%. That is, the proposed MLP neural network approach reduces the error rate from 4.8% to 0.106% and increases the accuracy from 95.2% to 99.894%.Table 5
Performance comparisons between the MLP model_3 and random forest model.
Model nameError rateAccuracyPrecisionRecallF1 scoreTimeModel_30.106%99.894%97.352%99.319%96.163%1 sRandom forest4.8%95.2%95.0%95.3%95.0%34 s


#### 4.2.3. Comparisons between Park et al.’s Method [14] and the Proposed Best MLP Model

In 2021, Park et al. [14] developed the random forest model and MLP model with XAI (Explainable Artificial Intelligence) modules using a dataset from the Korean MMORPG, AION, which includes game logs of human players and game bots. At first, Park et al. trained the random forest classifier and MLP classifier, respectively. The dataset contained two classes: Bot and Human, and it has been through the oversampling process due to the low number of data in the “Bot” class. 90% of the dataset was used to train the models, and the rest of the data were for validation. The validation accuracy of the random forest model is 88.51%, while the MLP model reached over 90.10%. Therefore, the proposed best MLP model, model_3, with an accuracy of 99.894% is superior to Park et al.’s random forest model and MLP model. Table 6 shows the accuracy comparison between Park et al.’s method and the proposed MLP model_3.Table 6
Accuracy comparison between Park et al.’s method [14] and the proposed MLP model_3.
Model NameAccuracyModel_399.894%Park et al.’s random forest model [14]88.51%Park et al.’s MLP model [14]90.10%


### 4.3. Gray Area Processing

Since model_3 has the best performance as discussed in Table4, we use model_3 to calculate every player’s abnormal rate, then cluster players based on their abnormal rate, and further define the gray area. Meanwhile, we generate data named Data_1 (20 players) and Data_2 (50 players) to detect whether the gray area is accurate or not. We also use this Data_1 and Data_2 to test the random forest method to see whether it can be accurate in detecting the gray area. In these players, each data is very close to the threshold limit value (TLV) of its field so that we can simulate players who are usually judged incorrectly in the game. We are going to use two metrics, false-positive rate (FPR) and false-negative rate (FNR), to evaluate the performance of the best MLP neural network model_3 and the random forest model. In the following, we first measure model_3 on Data_1, and the experimental result shows that FPR and FNR are both 0.0%. This means no player is misjudged, and all players are correctly detected. Then, we measure model_3 using Data_2, and the experimental result shows that FPR and FNR are 0.196% and 0.184%, respectively. On the contrary, the random forest model’s FPR is 0.29% and FNR is 0.23% on Data_1 and 0.305% FPR and 0.350% FNR on Data_2. Therefore, model_3 has better detection performance, which can be more accurate to detect the gray area’s players and reduce the possibilities of misjudgment.


### 4.4. Summary

The above experimental results show that the proposed MLP neural network model has better performance than the random forest model under the same dataset. The best MLP neural network model, model_3, increases accuracy from 95.2% to 99.894%, increasesF1 score from 95.0% to 99.163%, and reduces error rate from 4.8% to 0.106%. In summary, our proposed model can be more accurate to detect game bots.In terms of the gray area, the MLP neural network model can be almost fully accurate to judge the blurred players on Data_1, and it has 0.0% FPR and FNR. However, the random forest model still has a slight error; that is, it has 0.29% FPR and 0.23% FNR on Data_1. Although model_3 has a slight error on Data_2, it is a drop in the bucket as compared with the random forest model. The random forest model has a large error on judging players, and it will make players unsatisfied about it. Accordingly, model_3 is superior to the random forest model.


## 4.1. Dataset Description and Preprocessing

We evaluate the proposed bot detection in the mobile online KANO game’s dataset. The dataset recorded the players’ data from 2019 to 2021, including normal and abnormal behaviors. We extract these three years’ player data which comprise about 210,000 players (130,000 normal and 80,000 abnormal players).The dataset also contains labels that are used to mark whether a player is normal. Labels are either 0 or 1, which means a human and a bot, respectively. Because enough data can make detection more accurate, all 210,000 data are used to train the model. The data preprocessing function is used to process the raw data, and then, the proposed MLP model will be built.


## 4.2. Experimental Setting and Results

In this section, we present the experimental results acquired from different MLP neural network models and a widely used random forest machine learning model with the same dataset. The training model environment is on NVIDIA GTX 1050Ti GPUs with 4 GB memory.We set training parameters to separate the dataset into training and testing data with different ratios, where different ratios will have different results. As discussed in Section3, Table 3 describes the specifications of models used in experiments. To simplify the expression, we name each model with a different name listed in Table 3 to explain the experimental results.Table 3
Specifications of different MLP models.
ItemsModel_1Model_2Model_3Model_4Layer2222Neuron50, 4050, 4050, 4050, 40Activation functionReLu, sigmodReLu, sigmodReLu, sigmoidReLu, sigmoidLoss functionBinary cross-entropyBinary cross-entropyBinary cross-entropyBinary cross-entropyOptimizerAdamAdadeltaAdamaxNadamSplit of validation0.10.30.20.4Epochs30201215Batch_size1000500095007000We contrast among different MLP models to choose the best model by estimating the results with the same dataset. We also contrast between the MLP model and random forest algorithm. The random forest algorithm was developed by Breiman [30], which has many merits, e.g., being able to process large input variables, and is extensively used in machine learning. Accordingly, we select the random forest method as the baseline of the general machine learning model in the experiments. We evaluate the experimental results using five metrics, including the error rate, accuracy, precision, recall, and F1 score. In the following, we first list the comparisons among the proposed four MLP neural network models, then conduct the comparisons between the random forest machine learning and the proposed best MLP neural network from the same KANO game players’ dataset, and further make comparisons between Park et al.’s method [14] and the proposed best MLP model.


### 4.2.1. Comparisons among the Proposed Four MLP Models

We compare the performance of four different MLP neural network models with the same amount of data in this experiment. The differences among the four models are the optimizer, split of validation, epochs, and batch size. To strengthen the accuracy or reduce the error rate, we will increase the number of epochs and use more times of training periods to improve them. However, it still needs to consider other variables, including a split of validation or batch size; if we do not consider these variables, it may increase the training time, decrease the accuracy, and therefore raise the error rate. Table4 demonstrates the results of the performance comparisons among these four different MLP models. We find that these four MLP neural network models reach a similar performance in the experimental results. Especially, model_3 has the best accuracy, precision, recall, F1 score, and the most reduced error rate. The accuracy in model_3 is extremely high, 99.894%. The F1 score is the combination of precision and recall. Unlike accuracy, F1 does not involve TN, true normal users, which are usually more than true abnormal users. F1 in model_3 is also very high, 96.163%. Precision shows the influences of FP against TP, and recall reflects FN. Both of them in model_3 are the best, and recall is relatively higher than precision. So, model_3 can provide extremely low FP, which is more critical than FN due to the large among of normal users, and still provide very low FN to detect abnormal users.Table 4
Performance comparisons among different MLP models.
MetricsModel_1Model_2Model_3Model_4Error rate3.818%1.382%0.106%1.659%Accuracy96.182%98.618%99.894%98.341%Precision96.58%97.013%97.352%97.116%Recall98.057%97.219%99.319%98.127%F1 score96.123%96.142%96.163%96.125%Total training time (second)22 s16 s1 s7 sMoreover, Figures3 and 4 separately illustrate accuracy and loss for training iterations of model_3 in the experiment. Chollet [31] indicated that if a proposed model has a large gap between its training error curve and validation error curve, it shows the proposed model may have a big problem of overfitting. In the experimental result of model_3, the gaps between the training and validation sets in accuracy and loss are both very small, which means there is not too much phenomenon of overfitting or underfitting in the training iterations.Figure 3
Accuracy for training iterations of model_3.Figure 4
Loss for training iterations of model_3.


### 4.2.2. Comparisons between the Random Forest Machine Learning and Proposed Best MLP Model from the Same KANO Game Players’ Dataset

Here, we contrast the performance of the MLP neural network and random forest models. In the next section, we will compare the performance of detecting the gray area between the two models. Based on the above analysis, we select model_3 as the representative of various MLP neural networks and compare it with the random forest method. Table5 shows the contrast between model_3 and the random forest model with the same dataset. The contrast result shows that the best model_3 achieves the error rate of 0.106%, accuracy of 99.894%, and F1 score of 99.163%, while the random forest model (with the same dataset) achieves the error rate of 4.8%, accuracy of 95.2%, and F1 score of 95.0%. That is, the proposed MLP neural network approach reduces the error rate from 4.8% to 0.106% and increases the accuracy from 95.2% to 99.894%.Table 5
Performance comparisons between the MLP model_3 and random forest model.
Model nameError rateAccuracyPrecisionRecallF1 scoreTimeModel_30.106%99.894%97.352%99.319%96.163%1 sRandom forest4.8%95.2%95.0%95.3%95.0%34 s


### 4.2.3. Comparisons between Park et al.’s Method [14] and the Proposed Best MLP Model

In 2021, Park et al. [14] developed the random forest model and MLP model with XAI (Explainable Artificial Intelligence) modules using a dataset from the Korean MMORPG, AION, which includes game logs of human players and game bots. At first, Park et al. trained the random forest classifier and MLP classifier, respectively. The dataset contained two classes: Bot and Human, and it has been through the oversampling process due to the low number of data in the “Bot” class. 90% of the dataset was used to train the models, and the rest of the data were for validation. The validation accuracy of the random forest model is 88.51%, while the MLP model reached over 90.10%. Therefore, the proposed best MLP model, model_3, with an accuracy of 99.894% is superior to Park et al.’s random forest model and MLP model. Table 6 shows the accuracy comparison between Park et al.’s method and the proposed MLP model_3.Table 6
Accuracy comparison between Park et al.’s method [14] and the proposed MLP model_3.
Model NameAccuracyModel_399.894%Park et al.’s random forest model [14]88.51%Park et al.’s MLP model [14]90.10%


## 4.2.1. Comparisons among the Proposed Four MLP Models

We compare the performance of four different MLP neural network models with the same amount of data in this experiment. The differences among the four models are the optimizer, split of validation, epochs, and batch size. To strengthen the accuracy or reduce the error rate, we will increase the number of epochs and use more times of training periods to improve them. However, it still needs to consider other variables, including a split of validation or batch size; if we do not consider these variables, it may increase the training time, decrease the accuracy, and therefore raise the error rate. Table4 demonstrates the results of the performance comparisons among these four different MLP models. We find that these four MLP neural network models reach a similar performance in the experimental results. Especially, model_3 has the best accuracy, precision, recall, F1 score, and the most reduced error rate. The accuracy in model_3 is extremely high, 99.894%. The F1 score is the combination of precision and recall. Unlike accuracy, F1 does not involve TN, true normal users, which are usually more than true abnormal users. F1 in model_3 is also very high, 96.163%. Precision shows the influences of FP against TP, and recall reflects FN. Both of them in model_3 are the best, and recall is relatively higher than precision. So, model_3 can provide extremely low FP, which is more critical than FN due to the large among of normal users, and still provide very low FN to detect abnormal users.Table 4
Performance comparisons among different MLP models.
MetricsModel_1Model_2Model_3Model_4Error rate3.818%1.382%0.106%1.659%Accuracy96.182%98.618%99.894%98.341%Precision96.58%97.013%97.352%97.116%Recall98.057%97.219%99.319%98.127%F1 score96.123%96.142%96.163%96.125%Total training time (second)22 s16 s1 s7 sMoreover, Figures3 and 4 separately illustrate accuracy and loss for training iterations of model_3 in the experiment. Chollet [31] indicated that if a proposed model has a large gap between its training error curve and validation error curve, it shows the proposed model may have a big problem of overfitting. In the experimental result of model_3, the gaps between the training and validation sets in accuracy and loss are both very small, which means there is not too much phenomenon of overfitting or underfitting in the training iterations.Figure 3
Accuracy for training iterations of model_3.Figure 4
Loss for training iterations of model_3.


## 4.2.2. Comparisons between the Random Forest Machine Learning and Proposed Best MLP Model from the Same KANO Game Players’ Dataset

Here, we contrast the performance of the MLP neural network and random forest models. In the next section, we will compare the performance of detecting the gray area between the two models. Based on the above analysis, we select model_3 as the representative of various MLP neural networks and compare it with the random forest method. Table5 shows the contrast between model_3 and the random forest model with the same dataset. The contrast result shows that the best model_3 achieves the error rate of 0.106%, accuracy of 99.894%, and F1 score of 99.163%, while the random forest model (with the same dataset) achieves the error rate of 4.8%, accuracy of 95.2%, and F1 score of 95.0%. That is, the proposed MLP neural network approach reduces the error rate from 4.8% to 0.106% and increases the accuracy from 95.2% to 99.894%.Table 5
Performance comparisons between the MLP model_3 and random forest model.
Model nameError rateAccuracyPrecisionRecallF1 scoreTimeModel_30.106%99.894%97.352%99.319%96.163%1 sRandom forest4.8%95.2%95.0%95.3%95.0%34 s


## 4.2.3. Comparisons between Park et al.’s Method [14] and the Proposed Best MLP Model

In 2021, Park et al. [14] developed the random forest model and MLP model with XAI (Explainable Artificial Intelligence) modules using a dataset from the Korean MMORPG, AION, which includes game logs of human players and game bots. At first, Park et al. trained the random forest classifier and MLP classifier, respectively. The dataset contained two classes: Bot and Human, and it has been through the oversampling process due to the low number of data in the “Bot” class. 90% of the dataset was used to train the models, and the rest of the data were for validation. The validation accuracy of the random forest model is 88.51%, while the MLP model reached over 90.10%. Therefore, the proposed best MLP model, model_3, with an accuracy of 99.894% is superior to Park et al.’s random forest model and MLP model. Table 6 shows the accuracy comparison between Park et al.’s method and the proposed MLP model_3.Table 6
Accuracy comparison between Park et al.’s method [14] and the proposed MLP model_3.
Model NameAccuracyModel_399.894%Park et al.’s random forest model [14]88.51%Park et al.’s MLP model [14]90.10%


## 4.3. Gray Area Processing

Since model_3 has the best performance as discussed in Table4, we use model_3 to calculate every player’s abnormal rate, then cluster players based on their abnormal rate, and further define the gray area. Meanwhile, we generate data named Data_1 (20 players) and Data_2 (50 players) to detect whether the gray area is accurate or not. We also use this Data_1 and Data_2 to test the random forest method to see whether it can be accurate in detecting the gray area. In these players, each data is very close to the threshold limit value (TLV) of its field so that we can simulate players who are usually judged incorrectly in the game. We are going to use two metrics, false-positive rate (FPR) and false-negative rate (FNR), to evaluate the performance of the best MLP neural network model_3 and the random forest model. In the following, we first measure model_3 on Data_1, and the experimental result shows that FPR and FNR are both 0.0%. This means no player is misjudged, and all players are correctly detected. Then, we measure model_3 using Data_2, and the experimental result shows that FPR and FNR are 0.196% and 0.184%, respectively. On the contrary, the random forest model’s FPR is 0.29% and FNR is 0.23% on Data_1 and 0.305% FPR and 0.350% FNR on Data_2. Therefore, model_3 has better detection performance, which can be more accurate to detect the gray area’s players and reduce the possibilities of misjudgment.


## 4.4. Summary

The above experimental results show that the proposed MLP neural network model has better performance than the random forest model under the same dataset. The best MLP neural network model, model_3, increases accuracy from 95.2% to 99.894%, increasesF1 score from 95.0% to 99.163%, and reduces error rate from 4.8% to 0.106%. In summary, our proposed model can be more accurate to detect game bots.In terms of the gray area, the MLP neural network model can be almost fully accurate to judge the blurred players on Data_1, and it has 0.0% FPR and FNR. However, the random forest model still has a slight error; that is, it has 0.29% FPR and 0.23% FNR on Data_1. Although model_3 has a slight error on Data_2, it is a drop in the bucket as compared with the random forest model. The random forest model has a large error on judging players, and it will make players unsatisfied about it. Accordingly, model_3 is superior to the random forest model.


## 5. Conclusions

This study proposes an effective bot detection approach for a mobile online game based on the MLP neural networks, which cannot only help enhance the performance of detecting game bots but also identify gray area players. We first collect the dataset of the mobile online game and extract its features, and then by preprocessing raw data and training the models, the proposed game bot detection approach uses four models to evaluate and further selects the best model as the baseline of the approach. The experimental results show that the proposed game bot detection model increases the accuracy from 95.2% to 99.894% and reduces the error rate from 4.8% to 0.106%, as compared with the widely used random forest algorithm in machine learning with the same players’ dataset. In addition, the proposed deep neural network-based approach has better performance in detecting game bots, especially in the gray area, as compared with the widely used machine learning techniques. Furthermore, the proposed approach uses an automatic mechanism to reduce the human resources on detecting game bots and is also suitable for other games that use a back-end database to record players’ data.To extend the accomplishment of this work, we will further apply the proposed method of this work to explore the gray area in the other games. Although the other games may have different data distributions, they may have gray areas that cause false positives and negatives. This work currently utilizes the KANO game as an example to demonstrate the advantage of the proposed method. In the future, we will use the proposed method to distinguish the gray areas of the other games and check the players in the gray areas. In such a way, we will be able to show this work can also increase the game bot detection rate in the other games.



---

*Source: 9429475-2022-03-29.xml*