Evasion Generative Adversarial Network for Low Data Regimes

Rizwan Hamid Randhawa,
Nauman Aslam,
Mohammad Alauthman,
Husnain Rafiq

Manuscript received October XX, 2021; revised MONTH X, 2021 and MONTH XX, 2022; accepted MONTH X, 2022. Date of publication MONTH X, 2022; date of current version MONTH XX, 2022. This work was supported under the Research and Development Fund (RDF) of Northumbria University, Newcastle upon Tyne, UK.)

Rizwan Hamid Randhawa, Nauman Aslam and Husnain Rafiq are with the Department of Computer and Information Sciences, Northumbria University, Newcastle upon Tyne, UK (e-mail: rizwan.randhawa, nauman.aslam<EMAIL_ADDRESS>
Mohammad Alauthman is with the Department of Information Security, University of Petra, Amman 11196, Jordan (e-mail<EMAIL_ADDRESS>
Accepted for publication in one of the future volumes of IEEE Transactions on Artificial Intelligence
Randhawa et al.: Evasion Generative Adversarial Network for Low Data Regimes

A myriad of recent literary works has leveraged generative adversarial networks (GANs) to generate unseen evasion samples. The purpose is to annex the generated data with the original train set for adversarial training to improve the detection performance of machine learning (ML) classifiers. The quality of generated adversarial samples relies on the adequacy of training data samples. However, in low data regimes like medical diagnostic imaging and cybersecurity, the anomaly samples are scarce in number. This paper proposes a novel GAN design called Evasion Generative Adversarial Network (EVAGAN) that is more suitable for low data regime problems that use oversampling for detection improvement of ML classifiers. EVAGAN not only can generate evasion samples, but its discriminator can act as an evasion-aware classifier. We have considered Auxiliary Classifier GAN (ACGAN) as a benchmark to evaluate the performance of EVAGAN on cybersecurity (ISCX-2014, CIC-2017 and CIC2018) botnet and computer vision (MNIST) datasets. We demonstrate that EVAGAN outperforms ACGAN for unbalanced datasets with respect to detection performance, training stability and time complexity. EVAGAN's generator quickly learns to generate the low sample class and hardens its discriminator simultaneously. In contrast to ML classifiers that require security hardening after being adversarially trained by GAN-generated data, EVAGAN renders it needless. The experimental analysis proves that EVAGAN is an efficient evasion hardened model for low data regimes for the selected cybersecurity and computer vision datasets. Code will be available at HTTPS://www.github.com/rhr407/EVAGAN.

Artificial Intelligence (AI) applications can help improve the quality of human life. The use of AI is not only limited to medical anomaly detection and drug discovery but can be leveraged in computer networks to keep people safe from malicious activities on the Internet. However, the AI-based models can be biased towards the majority class of data on which they are trained due to data imbalance. Anomaly data samples are always scarce as compared to normal data samples. So this is an open research problem to solve. Our work is an effort to improve the AI-based methods in detection performance, stability and time complexity. Using the proposed technique, we can train our AI model using fewer anomaly samples, improving the cost-efficiency compared to state-of-the-art in anomaly detection.

Low Data Regimes, GANs, ACGAN, EVAGAN, Botnet, MNIST

§ INTRODUCTION

Low data regimes are found in many real-life applications in which researchers face data scarcity problems [1]. The data scarcity pertains to the situation where one class is abundant in data samples (especially normal behaviour) while the anomaly samples are rare and challenging to gather [2]. The data scarcity can also be described as a data imbalance problem potentially resulting in decision bias in machine learning (ML) classifiers. The network traffic datasets are one of the prime examples of data imbalance problems. Since the ML intrusion detection systems are data-hungry probabilistic models, having more data can improve their performance [3]. The real attacks can be emulated with dedicated machines in a lab environment using open-source operating systems like Kali Linux [4, 5]. However, there can be two main disadvantages of emulating real attacks: First, real data gathering can be expensive, involving multiple hardware resources like multiple computers and network switches [6]. Second, the emulated attacks may not accurately represent a real attack scenario. A cost-effective way of gathering the attacks' data is synthetic generation using AI generative models [7].

Synthetic data generation is also termed data oversampling. Using generative adversarial networks (GANs) as synthetic oversamplers has been a voguish research endeavour for low data regimes [3, 8]. Various researchers have demonstrated that GANs are more effective as compared to other synthetic oversamplers like SMOTE [2, 9, 7, 10]. It is found in numerous studies that due to the adversarial factor, GANs can better estimate the target probability distribution [2, 9, 11]. In a simple/vanilla GAN, two different neural networks generator ($\mathcal{G}$) and discriminator ($\mathcal{D}$) work antagonistically to learn from each other's experience to converge to Nash equilibrium [12]. As an oversampler, after being trained to a certain number of epochs, $\mathcal{G}$ is used to generate additional data. Depending on how well a GAN learned the input data probability distribution, the close resembling data is annexed to the original train set. This process is called data augmentation (DA), which many researchers have demonstrated to be effective in improving the detection performance of ML classifiers [13, 14, 15, 16, 17].

Since AI-based systems are prone to adversarial evasion attacks, it is imperative to harden the ML classifiers against adversarial evasions. Black box attackers can use GANs to generate evasion samples [15, 16, 18]. Therefore, employing GANs can be an effective technique to proactively design an adversarial aware classifier resulting from DA. Although DA is effective in helping the ML classifiers recognise the perturbed data samples, $\mathcal{D}$ of a GAN can be extended to act as a multiclass classifier so that it can be used as an anomaly detector [19, 20, 16]. In this way, we do not need to use DA as the $\mathcal{D}$ is trained simultaneously with $\mathcal{G}$. Auxiliary Classifier GAN (ACGAN) is an example of such a GAN in which the $\mathcal{D}$ not only differentiates between fake and real samples but also can be used as a multiclass classifier [2, 21]. The advantage of extending the $\mathcal{D}$ in ACGAN is to improve training stability, and quality of generated samples [21].
In this work, with the help of experimentation, we have demonstrated that ACGAN does not perform well in highly unbalanced datasets. So we propose a novel GAN based on ACGAN called EVAGAN that outperforms ACGAN in terms of detection performance, stability in training and time complexity.

We summarise the main contributions of this paper in the following aspects:

* We propose a novel GAN model to design an evasion-aware discriminator as a sophisticated botnet detector.

* We demonstrate by experiments that the existing use of ACGAN to design a sophisticated classifier can fail in highly unbalanced datasets.

* We determine that EVAGAN outperforms ACGAN in terms of performance detection, stability and time complexity for cybersecurity (CC) botnet and computer vision (CV) datasets.

Table <ref> shows the main notations used in this paper. The rest of this paper has been organized as follows. Section <ref> provides a comprehensive background of vanilla GANs, data oversampling, adversarial evasion and ACGAN, section <ref> presents the details of the proposed model, section <ref> gives a description of implementation details, section <ref> demonstrates the results, section <ref> provides an analysis of the results and section <ref> concludes the paper.

§ BACKGROUND

Main notations

1|c|Normal distribution from noise space

1|c|Noise samples

1|c|Probability distribution of real samples

1|c|Probability distribution of noise samples

1|c|Real data distribution

1|c|Expected value

1|c|Minority class labels

1|c|Majority class labels

1|c|Actual label of sample $x_i$ in dataset $\mathcal{X}$

§.§ Generative Adversarial Networks (GANs)

A GAN combines two different neural networks, each having a unique structure. The one responsible for generating synthetic samples is called generator ($\mathcal{G}$), and the other that evaluates the generated samples is called discriminator ($\mathcal{D}$). Figure <ref> shows the block diagram of a classical/vanilla GAN. There are two consecutive steps in which a GAN is trained. In the first step, the $\mathcal{D}$ is trained on real data labelled as REAL, and the data generated by an untrained $\mathcal{G}$ is labelled as FAKE. In the next step, now that the $\mathcal{D}$ has trained already, it is tested on the fake data from $\mathcal{G}$, but this time intentionally labelled as REAL. The loss of the $\mathcal{D}$ on this falsely labelled data is fed back to the $\mathcal{G}$ which adjusts its weights in one complete batch training. There can be several batch iterations, after which one complete traversal of the dataset is complete, also known as an epoch. In the classical GAN, the generator model can be represented as $\mathcal{G}$: z$\,\to\,$ $\mathcal{X}$ where z is the normal distribution from noise space and $\mathcal{X}$ is the real data distribution.

The discriminator $\mathcal{D}$: $\mathcal{X}$ $\,\to\,$[0,1] model is a classifier that outputs an estimate of probability between 0 and 1 to mark whether the input data is real or fake. The objective function of the combined model can be represented by Equation <ref>.

\begin{equation} \label{eq1}
\begin{aligned}
\min_\mathcal{G} \max_\mathcal{D} V(\mathcal{\mathcal{D}}, \mathcal{G})= \mathbb{E}_{x\sim p_{data}(x)}[\log \mathcal{D}(x)] + \\ \mathbb{E}_{z\sim p_z(z)}[\log(1 - \mathcal{D}(\mathcal{G}(z)))]
\end{aligned}
\end{equation}

Here, $\mathbb{E}$ represents the expected value of the loss, and $x$ and $z$ denote the real and noise samples, respectively. At the same time, $p_{data}$ and $p_{z}$ are the probability distributions of real and noise data, respectively. The objective of a min-max game is to minimise the generator's loss in creating data resembling real data. Since the generator can not control the loss of $\mathcal{D}$ on real data, still, it can maximise the loss of $\mathcal{D}$ on generated data $\mathcal{G}(z)$. The objective function of $\mathcal{G}$ is given by Equation <ref>.

\begin{equation} \label{eq2}
\begin{aligned}
J^\mathcal{G}(\mathcal{G})= \mathbb{E}_{z\sim p_z(z)}[\log(\mathcal{D}(\mathcal{G}(z)))]
\end{aligned}
\end{equation}

As demonstrated in the Figure <ref>, the losses of $\mathcal{D}$ on real $D\_Loss(REAL)$ and generated data $D\_Loss(FAKE)$ respectively, are fed to $\mathcal{D}$ using back-propagation. In the next step, in forward propagation, given label as REAL to the input generated samples (coming from $\mathcal{G}$), the evaluation is done by $\mathcal{D}$ and $G\_Loss(REAL)$, is fed back to $\mathcal{G}$ to update its weights. We call this step the combined model training. The combined model takes noise as input and the output of the $\mathcal{D}$ as the feedback to update the weights of the $\mathcal{G}$. This process keeps iterating till the number of epochs reaches a set value. The generator and discriminator do not learn further upon achieving the Nash equilibrium.

Block Diagram of a classical GAN

§.§ Data Oversampling & GANs

In low data regimes, oversampling or undersampling can help balance the datasets. However, undersampling might result in the loss of diversity. For oversampling, methods like SMOTE use nearest neighbours, and linear interpolation, which can be unsuitable for high-dimensional and complex probability distributions [22, 9]. Recent research works proposed algorithms for data oversampling. Authors in [23] compared 85 different oversampling techniques and suggested the three best-performing variants as SMOTE_IPF, ProWSyn and polynom_fit_SMOTE. In [7], authors have compared the performance of these three SMOTE variants with GANs. Through empirical results, they found that GANs outperform the three mentioned oversamplers in most of the adversarial training of ML classifiers.

§.§ ACGAN

ACGAN extends a classical GAN exploiting class labels in the training process [21]. Similar to a classical GAN, ACGAN includes two neural networks: a Generator ($\mathcal{G}$) and a Discriminator ($\mathcal{D}$). In addition to random noise samples $z$, the input of $\mathcal{G}$ includes class labels $c$. Therefore, the synthesized sample from $\mathcal{G}$ in ACGAN is $\mathcal{X}_{fake} = \mathcal{G} (c, z)$, instead of $\mathcal{X}_{fake} = \mathcal{G} (z)$. In other terms, ACGAN can generate the specified class data for which we feed labels to its $\mathcal{G}$. Simultaneously, the $\mathcal{D}$ of ACGAN works as a dual classifier for differentiating between the real/fake data and different classes of the input samples, whether coming from the real source or the $\mathcal{G}$.

The objective function of ACGAN consists of two parts: The first is the log-likelihood $L_S$ of the correct source data, and the second is the log-likelihood $L_C$ of the real class labels. $\mathcal{D}$ is trained to maximise $L_{C} + L_{S}$ and $\mathcal{G}$ learns to maximise $L_{C} - L_{S}$. In other words, the objective of $\mathcal{D}$ is to improve the two likelihoods, while the goal of $\mathcal{G}$ is to assist $\mathcal{D}$ in improving the performance on class label discrimination. $\mathcal{G}$ will also try to suppress the log-likelihood of $\mathcal{D}$ on fake samples. The $\mathcal{D}$ outputs both a probability distribution over sources and the class labels respectively [$P (S | \mathcal{X}), P (C | \mathcal{X})] = \mathcal{D}(\mathcal{X})$ where $S$ are the sources (real/fake) and $C$ are the class labels. Equations <ref> and <ref> denote the $L_s$ and $L_c$ respectively.

\begin{equation} \label{eq3}
\begin{aligned}
L_{S} = \mathbb{E}[log P (S = real | \mathcal{X}_{real} )]\ + \\
\mathbb{E}[log P (S = fake | \mathcal{X}_{fake} )]
\end{aligned}
\end{equation}

\begin{equation} \label{eq4}
\begin{aligned}
L_{C} = \mathbb{E}[log P (C = c| \mathcal{X}_{real} )]\ + \\
\mathbb{E}[log P (C = c | \mathcal{X}_{fake} )]
\end{aligned}
\end{equation}

Comparison of EVAGAN model with vanilla GAN and ACGAN

A careful observation of Figure <ref> suggests that there seems to be no tremendous difference between ACGAN and EVAGAN; however, the significance of simple modifications in the generator input, discriminator output and loss functions is discussed in more detail in section <ref>.

§.§ Adversarial Evasion & GANs

The decision bias in ML classifiers can lead to the misclassification of malicious samples as normal. The attackers can exploit this intrinsic nature of ML classifiers to incarnate evasion samples, particularly in low data regimes. The adversarial evasion j* is a perturbed version of an input sample j such that the j* = j + $\eta$, where $\eta$ is a carefully crafted perturbation. When making an adversarial attack, $\eta$ could be sought and selected so that the classifier can not discriminate the j* from j [24, 25]. The researchers usually employ adversarial training to make the classifiers proactively aware of the evasion samples. However, this is not needed if we use the $\mathcal{D}$ of a GAN as a classifier to differentiate not only between the fake and real samples but also between normal and anomaly samples. The fake samples generated by the $\mathcal{G}$ are also learnt at the same time, so it is better to consider the power of $\mathcal{D}$ as an evasion-aware classifier. We do not need to use extra ML classifiers, which is a common practice in various literary works, to design such a classifier [20, 19].

To this end, we propose EVAGAN that provides such type of $\mathcal{D}$ and compare its performance with the $\mathcal{D}$ of ACGAN and other ML classifiers, xgboost (XGB), decision tree (DT), naive bayes (NB), random forests (RF), logistic regression (LR) and k-nearest neighbours (KNN). Following rigorous experimentation, we explore that EVAGAN's $\mathcal{D}$ not only outperforms the ML classifiers in black box testing but also gives 100% accuracy in normal and evasion samples estimation. The details of the experimental results will be discussed in section <ref>.

§ EVAGAN

In this section, we discuss the motivation behind the design of EVAGAN, the structural explanation of its generator and discriminator, along with the objective and loss functions.

§.§ Motivation

Considering the generator ($\mathcal{G}$) of ACGAN, $\mathcal{X}_{fake} = \mathcal{G} (c, z)$ where $c$ is the class label, $\mathcal{G}$ has to generate the samples of all classes. Hence the number of the samples generated by $\mathcal{G}$ may include $C = \{c_1, c_2, c_3, ... , c_n\}$ which may not be a requirement in low data regimes. Since we only need to generate a low sample class with labels $c_m$ instead of all the classes, so the generator does not need to be aware of the classification performance of $\mathcal{D}$ on majority class samples. In this way, the training time of $\mathcal{G}$ is reduced as the diversity seen by the $\mathcal{G}$ is less complex to generate a single class sample. Due to this reason, we can not only improve the performance of the $\mathcal{G}$ but also can harden the $\mathcal{D}$ simultaneously with fewer $c_m$ samples. The ratio of the different class labels can vary the performance of $\mathcal{G}$ as this is a stochastic process. However, in most cases, the normal class samples will be more than the anomaly samples. Note that EVAGAN design is dedicated to binary class problems where the samples of a minority class are scanty. For using EVAGAN for multiclass cases, each anomaly class should be considered separately from the normal class to make it a binary classification problem. However, the concept can be extended to multiclass, which we leave to future work.

EVAGAN Architecture

§.§ Architecture

The design of EVAGAN is inspired by ACGAN as we want to develop a classifier model that hardens itself on the GAN-generated evasion samples. The main structure of EVAGAN consists of two neural networks; the generator $\mathcal{G}$ and the discriminator $\mathcal{D}$. In contrast to ACGAN, EVAGAN's model is limited to labels from a single class embedded with noise as the input to the generator ($\mathcal{G}$). The details of the $\mathcal{G}$ have been explained in subsection <ref>. Figure <ref> shows the detailed architecture of EVAGAN. There are three types of colour-graded arrows shown in the figure. The red coloured arrows demonstrate the first training step in which only $\mathcal{D}$ is trained. The green arrows depict the second training step for the $\mathcal{G}$. The orange arrows show the involvement of common inputs (minority class labels and noise) and outputs (real/fake and minority class estimations) for both training steps mentioned previously. These two steps of a typical GAN training were expressed earlier in subsection <ref>. The discriminator $\mathcal{D}$ of EVAGAN has three different outputs for the estimation of majority, minority and fake/real classes. Sigmoid functions have been used for the three outputs, each with binary cross-entropy (BCE) loss. The details of $\mathcal{D}$ are further expressed in subsection <ref>. The loss functions have also been mentioned in respective subsections of the $\mathcal{G}$ and $\mathcal{D}$.

Figure <ref> shows a red outlined box on the right side to illustrate the three different probability estimations as outputs from $\mathcal{D}$. These three estimations are used to compute the loss of $\mathcal{D}$ in the first step of EVAGAN training. A green outlined box, including the real/fake estimation and minority class estimation, computes the $G\_Loss$ to be fed back to the $\mathcal{G}$ in the backpropagation of the combined model training (second step of EVAGAN training). Note that the output of the $\mathcal{D}$ is distributed using three different sigmoid units to separate the probabilities of each class, i.e. the majority, sources (real/fake) and minority. The majority and minority class estimations could be combined using a single sigmoid function. However, keeping them separate has three advantages. The first is to avoid the loss of the majority class being fed back to the $\mathcal{G}$. Second, it simplifies the model with no extra training cost. Third, we can conveniently separate the predictions for the test set samples, which will be discussed in section <ref>.

§.§ Generator

The generator ($\mathcal{G}$) of EVAGAN only takes noise $n$ and the single class labels $c$ = 1. The labels are embedded in the input layer of the $\mathcal{G}$. The objective function of the $\mathcal{G}$ has two parts, as shown in Equations <ref> and <ref>.

\begin{equation} \label{eq5}
\begin{aligned}
I^\mathcal{G}(\mathcal{G})= \mathbb{E}_{z\sim p_z(z)}[\log(\mathcal{D}(\mathcal{G}(z)))]
\end{aligned}
\end{equation}

\begin{equation} \label{eq6}
\begin{aligned}
J^\mathcal{G}(\mathcal{G})= \mathbb{E}_{c_m\sim y_m}[\log P(C = c_{m} | \mathcal{X}_{m_{fake}})]
\end{aligned}
\end{equation}

Equation <ref> is the objective function of $\mathcal{G}$ similar to Equation <ref>. The goal is to minimise the log-likelihood of the fake samples being classified as fake by $\mathcal{D}$. In Equation <ref>, $J^\mathcal{G}(\mathcal{G})$ is the objective function of $\mathcal{G}$ for improving the log-likelihood of minority class samples coming from the $\mathcal{G}$ into the $\mathcal{D}$. Here, $y_m$ denotes the minority class label in the real dataset, and $P$ is the output probability from $\mathcal{D}$. Since the $\mathcal{G}$ only needs to generate $c_m$ samples so it should only receive the loss of $\mathcal{D}$ on the estimation of minority class and the sources, i.e. the samples being real or fake. The objective function of $\mathcal{G}$ is to maximise the $\mathcal{D}$ loss on the fake source. At the same time, it will assist in minimising the $\mathcal{D}$ loss on $c_m$ samples. Equation <ref> shows the objective function of $\mathcal{G}$.

\begin{equation} \label{eq7}
\begin{aligned}
L^\mathcal{G}(\mathcal{G}) = J^\mathcal{G}(\mathcal{G}) - I^\mathcal{G}(\mathcal{G})
\end{aligned}
\end{equation}

The cross-entropy (CE) loss of two different probability distributions $p(x)$ and $q(x)$ can be denoted using Equation <ref>, where x denotes the samples belonging to the $\mathcal{X}$ dataset.

\begin{equation} \label{eq8}
\begin{aligned}
CE(p,q) = - \sum\limits_{x\epsilon X} p(x) \log q(x)
\end{aligned}
\end{equation}

Let $y_{x_{i}}$ be the actual label of sample $x_i$ in dataset $\mathcal{X}$, $P(S = fake | \mathcal{X}_{m_{fake}})$ be the predicted probability distribution of generated samples being fake and $P(C = c_m | \mathcal{X}_{m_{fake}})$ be the predicted probability distribution from $\mathcal{D}$ for minority class labels $c_m$, then the loss function of $\mathcal{G}$ for $N$ samples will be given by the Equation <ref>.

\begin{equation} \label{eq9}
\begin{aligned}
G\_Loss = - \frac{1}{N}\sum\limits_{i = 1}^{N} [
y^{fake}_{x_{i}} (\log P(S = fake | \mathcal{X}_{m_{fake}})) + \\
y^{c_m}_{x_{i}} (1 - \log P(C = c_m | \mathcal{X}_{m_{fake}})) ]
\end{aligned}
\end{equation}

In Equation <ref>, $y^{fake}_{x_{i}}$ and $y^{c_m}_{x_{i}}$ are the actual labels for fake and minority classes respectively. According to Equation <ref>, the goal of $\mathcal{G}$ is to minimize the $G\_Loss$, so it tends to reduce the correct estimation of $\mathcal{D}$ on fake samples by suppressing the term $\log P(S = fake | \mathcal{X}_{m_{fake}})$. For the second objective, it will try to increase the value of $\log P(C = c_m | \mathcal{X}_{m_{fake}})$ so that the second term in the equation can also be suppressed in value.

§.§ Discriminator

For the $\mathcal{D}$ model of EVAGAN, we have separated the majority, and minority class estimations using two different sigmoid ($\sigma$) functions as demonstrated in Figure <ref>. The benefit of separating the majority and minority class estimations is that we can feedback only minority class estimation to the $\mathcal{G}$. The other advantage of this structure is that we can separately calculate the estimation of both classes on test datasets to compare it with the ACGAN model later done in section <ref>. The objective function of $\mathcal{D}$ has three parts as given by the Equations <ref>, <ref> and <ref>. For the minority class terminologies, we use '$m$', and for the majority class, we use '$M$' in the following equations.

\begin{equation} \label{eq10}
\begin{aligned}
L_M = \mathbb{E}_{c_M\sim y_{M_{real}}} [\log P(C=c_M|\mathcal{X}_{M_{real}})]
\end{aligned}
\end{equation}

\begin{equation} \label{eq11}
\begin{aligned}
L_{S_m} = \mathbb{E}_{y_{m_{real}}} [log P (S = real | \mathcal{X}_{m_{real}} )]\ + \\
\mathbb{E}_{y_{m_{fake}}} [log P (S = fake | \mathcal{X}_{m_{fake}} )]
\end{aligned}
\end{equation}

\begin{equation} \label{eq12}
\begin{aligned}
L_m = \mathbb{E}_{c_m\sim y_{m_{real}}} [\log P(C=c_m|\mathcal{X}_{m_{real}})]\ + \\
\mathbb{E}_{c_m\sim y_{m_{fake}}} [ \log P (C=c_m | \mathcal{X}_{m_{fake}} )]
\end{aligned}
\end{equation}

The first goal of the $\mathcal{D}$ is to correctly estimate the majority class distribution from the real samples only as $\mathcal{G}$ does not generate the majority class samples. Equation <ref> denotes the log-likelihood for the real majority class samples. Equation <ref> represents the source log-likelihood for the real and fake minority class samples. Equation <ref> summarises the real and fake log-likelihoods from the $\mathcal{D}$ for minority class samples. Hence, the objective function of the $\mathcal{D}$ can be represented as the sum of the three log-likelihoods to be maximised by the $\mathcal{D}$ as given by Equation <ref>

\begin{equation} \label{eq13}
\begin{aligned}
L^\mathcal{D}(\mathcal{D}) = L_M + L_{{S}_m} +L_m
\end{aligned}
\end{equation}

The loss function of $\mathcal{D}$ can be derived using Equation <ref> and <ref>, given by Equation <ref>.

\begin{equation} \label{eq14}
\begin{aligned}
D\_Loss = - \frac{1}{N}\sum\limits_{i = 1}^{N} [
y^{c_M}_{x_{i}} (\log P(S = c_M | \mathcal{X}_{M_{real}})) + \\
y^{real}_{x_{i}} (\log P(S = real | \mathcal{X}_{m_{real}})) + \\
(1 - y^{real}_{x_{i}}) (1 - \log P(S = real | \mathcal{X}_{m_{real}})) + \\
y^{c_{m_{real}}}_{x_{i}} (\log P(C = c_m | \mathcal{X}_{m_{real}})) + \\
(1 - y^{c_{m_{real}}}_{x_{i}}) (1 - \log P(C = c_m | \mathcal{X}_{m_{real}})) ]
\end{aligned}
\end{equation}

In Equation <ref>, the loss of $\mathcal{D}$ has been derived from three different binary cross-entropy losses for majority class, sources and minority class estimations. Note that we have ignored the loss on $c_M$ for being fake because no majority class samples are being generated by the $\mathcal{G}$.

§ IMPLEMENTATION DETAILS

§.§ Experimental Setup

The experiments were performed on a GPU workstation, AMD Ryzen threadripper 1950x with a 16-core processor and GeForce GTC 1070 Ti (8GB) graphics card, running ubuntu 20.04. Keras, TensorFlow, Sklearn and Numpy libraries were used in the Jupyter notebook and visual studio code (VSCode). The source code of EVAGAN has been provided on GitHub under MIT license[https: //github.com/rhr407/EVAGAN].

§.§ Data Preparation

For experimentation, we have used CC botnet and CV MNIST datasets. The quantitative analysis of EVAGAN was performed on CC datasets. We have followed the work done by the authors in [7] for dataset selection of botnet. We have used three datasets, ISCX-2014, CIC-2017 and CIC-2018, from the Canadian Institute of Cybersecurity (CIC). The features were extracted using a utility called CICFlowMeter-v4 provided by the CIC. We have inherited the same feature set as mentioned in [7]. The reader may refer to this article for more details on the feature set used for the three datasets. The number of samples of benign vs botnet is mentioned in Table <ref>. The qualitative analysis was performed using visual inspection. For this purpose, we used the MNIST handwriting digits dataset.

§.§ CC Datasets

Following is the detail of CC datasets and the botnet samples used in this work. This subsection also includes the preprocessing methodology for the selected datasets.

§.§.§ ISCX-2014 Dataset

The ISCX-2014 dataset [26] is a combination of three publicly available datasets ISOT [27], ISCX 2012 IDS [28] and CTU-13 [29]. As per the ISCX website's details, it complies with generality, realism, and representativeness. The generality represents the richness of diversity of botnet behaviour. Realism can be defined as the closeness with the actual traffic captured, and representativeness is the ability to reflect the real environment, which a botnet detector would need in deployment. Only the Virut botnet was selected for this work because it had fewer samples than other botnets except for Zeus, which had insufficiently low samples. The labels of SMTP or NSIS were not available on the website[https: //www.unb.ca/cic/datasets/botnet.html]. Hence, we used a subset with all the normal traffic flows and Virut samples. In this way, we could use this dataset as a good example of an unbalanced set. The distribution of the normal and Virut samples has been shown in Table <ref>.

§.§.§ CIC-IDS2017 Dataset

The botnet chosen for the CIC-IDS2017 was Ares. For this bot, the traffic was collected on Friday, July 7, 2017, from 10: 02 AM to 11: 02 AM in the CIC facility. The dataset is available on the CIC website[https: //www.unb.ca/cic/datasets/ids-2017.html]. Similar to ISCX-2014, a subset of this dataset using all the normal flows with the selected botnets was created. The ratio of the number of samples has been mentioned in Table <ref>.

§.§.§ CIC-IDS2018 Dataset

To create another subset of an unbalanced dataset for analysis, we used CIC-IDS2018. This dataset included samples for Ares and Zeus botnets. We created a subset of all the normal and 2560 botnet traffic flows to generate another unbalanced dataset.

Distribution of normal and botnet samples in cybersecurity botnet datasets

1|c|Total Samples

1|cVirut: 1748

1|cAres: 1956

1|cAres/Zeus: 2560

§.§.§ Feature Selection

The quality of a botnet dataset determines the performance of the botnet detectors in general and the number of distinct features in particular. A reduced feature set may not perform a stronger classification as compared to an enhanced set of non-redundant features [7]. In [26], the authors summarised the most important network flow features that could be helpful in botnet detection. We have used almost all of these features, which were mentioned in [30] as well. The CICFlowMeter-v4 utility was used to extract 80 flow and time-based features[https: //www.unb.ca/cic/datasets/ids-2018.html] from their $.pcap$ files. This utility can be advantageous for extracting the mentioned features for any input $.pcap$ file.

§.§.§ Preprocessing

The ISCX-2014 dataset has not been labelled to be used in ML-based experiments. We used the information provided on the CIC website for IPs associated with the particular botnets to label the dataset. After labelling, we performed preprocessing; All the high and low skewed values were removed to suppress outliers. The columns with NaN, Inf and zero standard deviation were removed. Finally, the dataset was scaled to the [0,1] range to use rectified linear unit (ReLU) activation function in the GAN model for data generation. The CIC-IDS2017 and CIC-IDS2018 were already labelled, so we only did preprocess for these two datasets after extracting the unbalanced subsets. Our experiments used 70% of the cybersecurity subsets as training sets, and the rest of the 30% was used for testing the models and ML classifiers.

§.§ CV Dataset

§.§.§ MNIST Dataset

The MNIST dataset is a simplified collection of handwritten digits ranging from 0 to 9 for training and testing various ML algorithms [31]. The purpose of using this dataset was to evaluate the performance of EVAGAN against ACGAN in terms of the visual quality of the images generated in balanced and unbalanced scenarios.

§.§ Model Comparison of EVAGAN with ACGAN

For comparison, we constructed four different variants of GANs, respectively ACGAN_CC, EVAGAN_CC, ACGAN_CV, and EVAGAN_CV. ACGAN_CC and EVAGAN_CC were trained and tested on CC datasets, and ACGAN_CV and EVAGAN_CV used CV datasets. The implementation details of each version in terms of hyperparameters can be found in Table <ref>.

§.§.§ ACGAN_CC & EVAGAN_CC

The structure of ACGAN_CC and EVAGAN_CC was made up of densely connected feed-forward neural network (FFNN) for both $\mathcal{G}$ and $\mathcal{D}$. The activation functions in hidden layers for both GANs were rectified linear units (ReLU). The hidden layers were regularized using batch normalization, and the optimizer type was Adam with binary cross-entropy (BCE). The difference between ACGAN_CC and EVAGAN_CC is in the output layers of $\mathcal{D}$. The $\mathcal{D}$ of ACGAN_CC outputs two neurons, one for the source probability and the other for the class probability for two classes (normal and botnet). The activation function is sigmoid for both outputs. The output layer structure of EVAGAN_CC has three neurons, one for the normal class, the second for the source probability, and the third for the botnet class (minority class). Each of the three outputs leverages the sigmoid as the activation function.

§.§.§ ACGAN_CV & EVAGAN_CV

The CV-based GAN architecture is different as it deals with image data compared to tabular data in CC. We need to use the convolutional neural network (CNN) instead of FFNN with other layers specific for image generation or detection. The output layer of $\mathcal{D}$ is similar to CC-based GAN implementations, except the Adam optimizer's loss function has BCE for source estimations and sparse categorical cross-entropy (SCCE) for class labels. Here, BCE could have been used; however, minimal changes to the code were made to maintain the integrity of the original ACGAN. However, in ACGAN_CC, we have used BCE as we converted the CNN-based code to FFNN ourselves. In this way, we could keep ACGAN_CC and EVAGAN_CC as similar as possible for a fair comparison.

CC and CV GAN Models

to 1|m2.8cm|m3cm|m3cm|m3cm|m3cm|

Network Type

Number of Layers
2c|$\mathcal{G}$: 5, $\mathcal{D}$: 5     2c|$\mathcal{G}$: 2, $\mathcal{D}$: 3

2c|$\mathcal{G}$: ReLU, $\mathcal{D}$: LeakyReLU (output: sigmoid)
2c|$\mathcal{G}$: ReLU (output: tanh), $\mathcal{D}$: ReLU (output: sigmoid, softmax)

Batch Size ($b$)

Neurons in input layer
4c|$\mathcal{G}$: latent dimension, class label vector size, $\mathcal{D}$: feature size

Neurons in layer 1
2c|$\mathcal{G}$ : 32, $\mathcal{D}$ : 128
$\mathcal{G}$ : 128, $\mathcal{D}$ : 32     $\mathcal{G}$ : 128, $\mathcal{D}$ : 32

Neurons in layer 2
2c|$\mathcal{G}$ : 64, $\mathcal{D}$ : 64
2c|$\mathcal{G}$ : 64, $\mathcal{D}$ : 64

Neurons in layer 3
2c|$\mathcal{G}$ : 128, $\mathcal{D}$ : 32
2c|$\mathcal{D}$ : 128

Neurons in output layer
$\mathcal{G}$ : feature size, $\mathcal{D}$ : 2
$\mathcal{G}$ : feature size, $\mathcal{D}$ : 3

$\mathcal{G}$ : feature size, $\mathcal{D}$ : 2
$\mathcal{G}$ : feature size, $\mathcal{D}$ : 3

Layer Regularization
4c|$\mathcal{G, D}$: $BatchNorm$

4c|Adam (beta_1=0.0002, beta_2=0.5)

Loss Function
2c|BCE, SCCE

Learning Rate

§ RESULTS

This section shows the results of the GAN implementations around two types of datasets: CC and CV GANs.

§.§ CC GANs

The results for quantitative analysis of the $\mathcal{D}$'s performance on generated samples validity (GEN_VALIDITY), fake/generated botnet samples evasion (FAKE_BOT_EVA), real normal/majority class estimation (REAL_NORMAL_EST) and real botnet/minority class evasion (REAL_BOT_EVA) have been demonstrated in Figure <ref>. The ML classifier results have also been shown in this figure for the three CC datasets for comparison. Equations from <ref>-<ref> represent the mathematical expressions for these performance indicators. We have used Keras $model.predict$ function to compute the values where the $model$ is $\mathcal{D}$ as our prime objective is to devise an intelligent evasion aware classifier. Following is a brief detail of each evaluation parameter.

§.§.§ GEN_VALIDITY

In Equation <ref>, $\hat {\mathcal{G}}(z,c_m)[0]$ denotes the predicted value for the source being fake or real. The Keras $model.predict$ function outputs an array, so the average of the first elements in the array will be the source validity of the generated samples after every epoch. The more this value is close to '1', the more it will be regarded as real.

\begin{equation} \label{eq15}
\begin{aligned}
GEN\_VALIDITY = \frac{\sum [
\hat {\mathcal{G}}(z,c_m)[0] ]}{N}
\end{aligned}
\end{equation}

§.§.§ FAKE_BOT_EVA

In Equation <ref>, $\hat {\mathcal{G}}(z,c\_m)[1]$ represents the probability estimation of generated minority/botnet class samples. Since the label for minority/botnet class is '0' so ideally, we expect the model to output a value close to '0'. We represent this estimation as the evasion of the generated samples. So the more this value is close to '0', the less evasion will be. Note that this is the second value in the sum of the $model.predict$ function output.

\begin{equation} \label{eq16}
\begin{aligned}
FAKE\_BOT\_EVA =\frac{\sum [
\hat {\mathcal{G}}(z,c_m)[1] ]}{N}
\end{aligned}
\end{equation}

§.§.§ REAL_NORMAL_EST

In Equation <ref>, $\hat {\mathcal{X}}_{normal_{test}}[2]$ represents the probability estimation of majority/normal class samples. Since the majority/normal class label is '1', ideally, we expect the model to output a value close to '1'. Note that this is the third value in the sum of the $model.predict$ function output for the normal samples from the test set.

\begin{equation} \label{eq17}
\begin{aligned}
REAL\_NORMAL\_EST = \frac{\sum {[
\hat {\mathcal{X}}_{normal_{test}}}[2] ]}{N}
\end{aligned}
\end{equation}

§.§.§ REAL_BOT_EVA

In Equation <ref>, $\hat {\mathcal{X}}_{botnet_{test}}[1]$ represents the probability estimation of the real minority/botnet class samples. Our expectation from the model is to output the value close to '0', similar to FAKE_BOT_EVA. This is the second value in the sum of the $model.predict$ function output for the botnet samples from the test set.

\begin{equation} \label{eq18}
\begin{aligned}
REAL\_BOT\_EVA =\frac{\sum {[
\hat {\mathcal{X}}_{botnet_{test}}}[1]]}{N}
\end{aligned}
\end{equation}

§.§.§ Losses

The losses of $\mathcal{D}$ for real and fake minority classes and majority/normal class and the loss of $\mathcal{G}$ have been demonstrated in Figure <ref> for both ACGAN and EVAGAN.

CC Estimations: The estimations on test data and data generated by the relative GANs along with the results of six different ML-classifiers

CC GANs Losses: The training losses for ACGAN and EVAGAN on three different CC datasets

§.§ CV GANs

For ACGAN_CV and EVAGAN_CV, we use MNIST handwritten digits dataset. Only two classes of digits, '0' and '1', were used in ACGAN_CV, as due to SCCE, its model does not accept fewer than two classes. For ECAGAN_CV, we use only the '0' digit as the minority class. Since the MNIST data is already balanced, we need to undersample the values of the '0' digit class to demonstrate the difference in performance. Four different undersampling levels have been devised in section <ref>. The evaluation parameters were equivalent to those used in CC GANs. For instance, GEN_Validity is the same as GEN_VALIDITY; GEN_Eva is similar to FAKE_BOT_EVA with the minority class from MNIST, i.e. '0' in our case. Similarly, ONE_Est is equivalent to REAL_NORMAL_EST, and ZERO_Eva is comparable to REAL_BOT_EVA in CC GANs. Figure <ref> demonstrates the quantitative results for the four undersampling scenarios. Note that out of four, the first scenario exhibits 0% undersampling. There are three scenarios with undersampling, 50%, 90% and 99%. For qualitative analysis, the output from $\mathcal{G}$s of both ACGAN_CV and EVAGAN_CV have been demonstrated in Figures <ref> and <ref>. These results are also based on the undersampling cases.

CV GANs estimations: The estimations on the test set for ACGAN and EVAGN for MNIST dataset in different undersampling scenarios. The range of the estimation value on the y-axis is from 0 to 1

CV GANs losses: The training losses on train set for ACGAN and EVAGN for MNIST dataset in different undersampling scenarios. The upper limit to the loss has been fixed to 4 for the sake of consistency to highlight the difference.

§ PERFORMANCE COMPARISON OF EVAGAN WITH ACGAN

§.§ Detection Performance

In Figure <ref>, for the ACGAN_CC, the values for the REAL_NORMAL_EST and REAL_BOT_EVA remain close to each other. This implies that the $\mathcal{D}$ of ACGAN_CC is not able to discriminate between the majority and minority classes well due to the imbalance problem in all the three CC datasets. The $\mathcal{D}$ of ACGAN_CC remains confused for the two classes in ISCX-2014 and CIC-2017 datasets. For the majority class, ACGAN_CC performs equally well as EVAGAN_CC for CIC-2018 (shown in the second row of Figure <ref>). However, due to the small number, it regards the minority class samples as the majority class instances. The second row in Figure <ref> shows the results of EVAGAN_CC for the estimations on the test set. It can be observed that as compared to ACGAN_CC, the $\mathcal{D}$ of EVAGAN_CC perfectly differentiates between the majority and minority classes and, after each epoch, tends to improve its detection performance for all the three CC datasets.

We have used FAKE_BOT_EVA as an indicator of evasion awareness of the $\mathcal{D}$ in the case of EVAGAN_CC only because ACGAN_CC generates two classes of data, so the $\mathcal{G}$ of ACGAN_CC would generate a random number of samples from both classes leading to non-deterministic values of FAKE_BOT_EVA. However, we compare the performance of this metric with ML classifiers. The last row of Figure <ref> shows the results of the six different ML classifiers for the values of the majority, minority and generated class samples. It can be inferred that EVAGAN_CC tends to outperform the ML classifiers for all three values after a certain number of epochs. The ML classifiers for black-box testing perform worst in the case of FAKE_BOT_EVA as compared to EVAGAN_CC for all the three CC datasets. This implies that the $\mathcal{D}$ of EVAGAN_CC is not only adept at discriminating between real minority samples but can also easily detect the fake minority samples that ML classifiers are not good at discerning. Another significant advantage of this $\mathcal{D}$ is that we do not need to employ ML classifiers in CC for learning adversarial evasion. Researchers use GANs to generate adversarial samples to be augmented with the training set for retraining ML classifiers to make them adversarially aware. In the case of EVAGAN_CC, we save that time as the $\mathcal{D}$ classifier/detector model is trained alongside the GAN training.

It can be further illustrated from Figure <ref> that the value of GEN_VALIDITY in the case of ACGAN_CC seems to remain close to 0.5 for all the three CC datasets. It means that the $\mathcal{D}$ is confused in deciding whether the generated samples from $\mathcal{G}$ are real or fake. However, in the case of EVAGAN_CC, for all the three datasets, $\mathcal{G}$'s performance is improving with each epoch. This implies that $\mathcal{D}$ is being fooled and still learning, while in the case of ACGAN_CC, the $\mathcal{D}$ has already been saturated because $\mathcal{G}$ is not generating new samples that can fool $\mathcal{D}$.

§.§.§ CV GANs

Figure <ref> demonstrated the results of different undersampling scenarios to mimic the low data regimes for the MNIST dataset. Note that the detection performance of the $\mathcal{D}$ for both ACGAN_CV and EVAGAN_CV for the majority and minority classes remains ideal from the very start. The reason is that, unlike CC datasets, the CV dataset has many strong features due to which $\mathcal{D}$ is easily able to differentiate between the '0' digit and '1' digit samples. However, the effect of undersampling can be seen for the minority class or digit '0' data. In contrast, the $\mathcal{D}$ of EVAGAN_CV seems to be smart enough to give steady values for all the undersampling cases, especially for minority class evasion (as depicted in red colour lines). Due to the sufficient number of samples, the majority class should be detected easily by both GANs. However, in the case of 99% undersampling, ACGAN_CV exhibits a poor performance even detecting this class. For GEN_Validity (represented by the blue lines), Figure <ref> shows that in undersampling cases, the performance of $\mathcal{G}$ of ACGAN_CV deteriorates in the worst manner and does not show any useful pattern of learning. This implies that in low data regimes, $\mathcal{G}$ is not performing any better as compared to EVAGAN_CV. However, EVAGAN_CV also shows the deterioration in $\mathcal{G}$'s performance, but that is not as phenomenal as that of ACGAN_CV.

§.§ Stability

The Figure <ref> shows the $\mathcal{D}$ and $\mathcal{G}$ losses for CC GANs. It can be inferred from this diagram that the values for all the losses seem to be converging. This shows that the GANs are saturating towards Nash equilibrium. However, in the case of EVAGAN_CC, the losses tend to be more steady with each epoch and achieve the lowest point sooner than ACGAN_CC.
Similarly, for CV GANs, the EVAGAN_CV losses in all the undersampling cases tend to be more stable as compared to ACGAN_CV as demonstrated in Figure <ref>.

Qualitative analysis of $\mathcal{G}$ for CV GANs with 0% and 50% undersampling of '0' digit class

Qualitative analysis of $\mathcal{G}$ for CV GANs with 90% and 99% undersampling of '0' digit class

§.§ Qualitative Performance

It is non-trivial to demonstrate the performance of a GAN in the case of CC datasets [32]. Since we can not visualize the generated network traffic, we need to validate the EVAGAN with the help of CV datasets. The rationale for using CV datasets is that if EVAGAN outperforms ACGAN in unbalanced scenarios, it would be equally acceptable for CC datasets. Since our purpose is not to generate quality traffic for CC, we need to design an evasion-aware anomaly detector. So, evaluating EVAGAN_CC for quality traffic generation is not within the scope of this work.

The previously mentioned undersampling scenarios for CV GANs have been demonstrated in Figures <ref> and <ref>. There are two $15\times10$ matrices of pictures in each figure. The number of images in each matrix equals the total number of epochs, i.e. 150. In each figure, the upper row belongs to the ACGAN_CV output of the $\mathcal{G}$ and the lower row corresponds to the output from $\mathcal{G}$ of EVAGAN_CV. Note that for ACGAN_CV, there are two classes being output from $\mathcal{G}$ and for EVAGAN_CV, only one '0' digit class is generated. For the undersampling scenario, which contains 50% fewer '0' class samples, the deterioration for ACGAN_CV starts getting evident, but EVAGAN_CV can generate '0' digits. For the case of 90% undersampling, the ACGAN_CV quality further deteriorates; however, EVAGAN_CV is still generating the '0' class samples, although slightly faded. As expected, in the 99% undersampling case, the ACGAN_CV is still struggling to generate the minority class digit '0', but an interesting case has happened for EVAGAN_CV. Since the number of samples is minuscule so the feedback taken from the $\mathcal{D}$ by $\mathcal{G}$, on some accidentally generated '1' digit,  gave a small value of $G\_Loss$. Due to this reason, the $\mathcal{G}$ started generating the majority class '1' digit after epoch 47. This situation is called a mode collapse, an inherent problem in GANs. However, we can infer that EVAGAN_CV may not perform well in a highly unbalanced scenario. This is an interesting research direction to investigate further using other CV datasets. On the other hand, ACGAN_CV is also stuck in mode collapse after epoch 140, where in place of class '0', the '1' class samples start appearing. However, in the case of EVAGAN_CV, despite mode collapse, the generated samples from class '1' are of higher quality which means that its $\mathcal{G}$ is more powerful as compared to that of ACGAN in highly unbalanced scenarios.

§.§ Time Complexity

The time complexity bar chart has been demonstrated in Figure <ref> where the y-axis represents the values of the training time in minutes. The MNIST dataset case with no undersampling was used to compare the results. The time complexity may vary on different platforms (for instance, Google Colab); however, the plot in Figure <ref> shows the results on the workstation that we have used (as mentioned in section <ref>). It can be observed that EVAGAN always takes less time than its counterpart for all four datasets. The reason lies in the notion that the $\mathcal{G}$ of EVAGAN in the cases of all the datasets needs to follow lesser diversity as compared to ACGAN. Although the batch size of 256 (given in Table <ref>) is the same for both GANs, the amount of time taken by EVAGAN is always less. Due to the stochastic nature of the input noise $z$ for the $\mathcal{G}$, we can not estimate the exact time in minutes for every training cycle; however, the average time of EVAGAN always remains less as compared to ACGAN.

A question might arise why we did not make ACGAN generate only the minority class samples. The answer to this question is that we would have to make changes in the structure of both $\mathcal{G}$ and $\mathcal{D}$ along with the loss functions. The SCCE loss does not allow us to use less than two classes, so we need to use BCE loss with other structural modifications. EVAGAN is the name of this transformation.

Time complexity

§ COMPARISON OF EVAGAN WITH PEER TECHNIQUES

The EVAGAN model is an enhanced version of ACGAN, dedicated to low data regimes for learning adversarial evasion examples generated during GAN training. So the most suitable existing model for the comparison can be ACGAN, the details of which have been explained in section <ref> previously. However, this section mentions peer techniques similar to EVAGAN that indirectly address the adversarial evasion problem. We have summarized the comparison in the following subsections and then in the form of a Table <ref>.

§.§ Data Augmentation

There are several techniques both in CV and CS that propose the data augmentation for enhancing the ML classifiers' performance [15, 3, 33, 34, 35, 36, 37, 38] . However, EVAGAN itself acts as a powerful adversarial evasion-aware model in which the discriminator ($\mathcal{D}$) acts as a classifier. So there is no need to generate evasion samples from a GAN model, augment with the training set and then train a separate ML classifier. This property of EVAGAN makes it superior to all the techniques based on data augmentation in terms of time complexity.

§.§ Computer Vision vs Cybersecurity Low Data Regimes

There are plenty of works that address the problem of low data regimes [39, 40, 41, 42, 43, 44, 45]. However, their datasets and model architectures differ from those used in this work. We have mentioned a few in Table <ref>. Since the ML studies are biased towards data, experimenting with other datasets can be a potential future work.

§.§ Architecture Comparison

Authors in [19] proposed a model in which the discriminator is acting as a multiclass classifier; however, their work is not destined towards adversarial evasion generation in low data regimes as they are considering the normal class samples to train the generator of their GAN. Our work differs in a way that we do not feed our generator ($\mathcal{G}$) with normal class samples, which makes the $\mathcal{G}$'s job easier. This saves the training time and improves the estimation accuracy of malicious samples, even being scanty.

§.§ Accuracy and Time Complexity

EVAGAN produces ideal results of estimation for both majority and minority classes, as high as 100% for all the datasets used, as mentioned in section <ref>. The comparison has been provided with ACGAN; however, the accuracy in comparison with other similar models is at par as well. The accuracy values determined from the literature for some other models addressing similar problems have been given in Table <ref>. The time complexity as compared to the ACGAN model has been discussed in section <ref> however; it would be non-trivial to compare with other peer models in respect of training time as the model architecture and hyperparameters vary enormously. The experiments for EVAGAN and ACGAN were performed on the same machine as mentioned in section <ref>, so we claim the time complexity comparison with ACGAN only.

Comparison with Peer Works

Paper     Addressing
Problem     Adversarial
Augmentation     Low
Data Regime     Architecture     Datasets Used     Maximum

ID-GAN [19]                 multiclass ACGAN    NSL-KDD      83.10%

G-IDS [3]                 vanilla GAN    NSL-KDD     -

AE-CGAN [33]                  Auto Encoder
with Conditional
GAN    CIC-2017     100%

[34]                 ANN, CNN, RNN    UNSW-NB15, NSL-KDD      97%

Attack-GAN [35]                 Sequence GAN    CTU-13     -

GADoT [36]                 WGAN-GP    Custom-SYN,  Scapy-SYN,
CICIDS2017,  UNB201X      -

DIGFuPAS [37]                 WGAN    CICIDS2017     -

min-max Training [46]                 DNN    NSL-KDD     93.4%

attackGAN [47]                 WGAN    NSL-KDD     -

CVAE-AN [38]                 Conditional VAE
and GAN    CICIDS2017      98%

CEGAN [48]                 CNN    MNIST, EMNIST,
F-MNIST CIFAR-10,
CINIC-10     96.48%

EVAGAN                  binary class ACGAN     ISCX-2014, CIC-2017,
CIC-2018, MNIST     100%

§ CONCLUSION

Adversarial evasion attacks on AI-based systems are a portending threat that needs to be dealt with using intuitive methods. Adversarial learning is one of the modern techniques to make ML classifiers proactively adept at detecting adversarial evasion samples. This paper proposes a novel GAN model called EVAGAN that generates adversarial evasions in low data regimes. EVAGAN is an enhancement of a well-known model called ACGAN. EVAGAN aims to design an adversarial-aware classifier for anomaly detection. We have used two datasets; one from the cybersecurity domain for botnets and the other from the computer vision called MNIST. EVAGAN's discriminator is superior to ACGAN in terms of detection performance, stability, and time complexity. At the same time, the qualitative analysis shows that EVAGAN outperforms ACGAN in unbalanced scenarios. EVAGAN model has been designed for binary classification problems.

Further investigation for multiclass design is a potential research direction. Experiments with other datasets would be highly desirable to further evaluate EVAGAN for the said parameters. For the qualitative analysis, handwritten digits other than '0' and '1' could be used to validate EVAGAN's superiority over ACGAN. A comparison with few-shot learning could be an interesting research direction.

[1]
M. Moret, L. Friedrich, F. Grisoni, D. Merk, and G. Schneider, “Generative
molecular design in low data regimes,” Nature Machine Intelligence,
vol. 2, no. 3, pp. 171–180, 2020.

[2]
L. Vu and Q. U. Nguyen, “Handling imbalanced data in intrusion detection
systems using generative adversarial networks,” Journal of Research
and Development on Information and Communication Technology, vol. 2020,
no. 1, pp. 1–13, 2020.

[3]
M. H. Shahriar, N. I. Haque, M. A. Rahman, and M. Alonso, “G-ids: Generative
adversarial networks assisted intrusion detection system,” in 2020
IEEE 44th Annual Computers, Software, and Applications Conference
(COMPSAC).1em plus 0.5em minus 0.4emIEEE, 2020, pp. 376–385.

[4]
I. Sharafaldin, A. H. Lashkari, and A. A. Ghorbani, “Toward generating a new
intrusion detection dataset and intrusion traffic characterization.” in
ICISSP, 2018, pp. 108–116.

[5]
A. H. Lashkari, G. Draper-Gil, M. S. I. Mamun, and A. A. Ghorbani,
“Characterization of tor traffic using time based features.” in
ICISSP, 2017, pp. 253–262.

[6]
N. Koroniotis, N. Moustafa, E. Sitnikova, and B. Turnbull, “Towards the
development of realistic botnet dataset in the internet of things for network
forensic analytics: Bot-iot dataset,” Future Generation Computer
Systems, vol. 100, pp. 779–796, 2019.

[7]
R. H. Randhawa, N. Aslam, M. Alauthman, H. Rafiq, and F. Comeau, “Security
hardening of botnet detectors using generative adversarial networks,”
IEEE Access, 2021.

[8]
V. Sushko, J. Gall, and A. Khoreva, “One-shot gan: Learning to generate
samples from single images and videos,” in Proceedings of the IEEE/CVF
Conference on Computer Vision and Pattern Recognition, 2021, pp. 2596–2600.

[9]
J. Engelmann and S. Lessmann, “Conditional wasserstein gan-based oversampling
of tabular data for imbalanced learning,” Expert Systems with
Applications, vol. 174, p. 114582, 2021. [Online]. Available:

[10]
G. Kovács, “Smote-variants: A python implementation of 85 minority
oversampling techniques,” Neurocomputing, vol. 366, pp. 352–354,

[11]
H. Ba, “Improving detection of credit card fraudulent transactions using
generative adversarial networks,” arXiv preprint arXiv:1907.03355v1,

[12]
I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair,
A. Courville, and Y. Bengio, “Generative adversarial nets,” in
Advances in neural information processing systems, 2014, pp.

[13]
A. Antoniou, A. Storkey, and H. Edwards, “Data augmentation generative
adversarial networks,” arXiv preprint arXiv:1711.04340, 2017.

[14]
T. Merino, M. Stillwell, M. Steele, M. Coplan, J. Patton, A. Stoyanov, and
L. Deng, “Expansion of cyber attack data from unbalanced datasets using
generative adversarial networks,” in International Conference on
Software Engineering Research, Management and Applications.1em plus
0.5em minus 0.4emSpringer, 2019, pp. 131–145.

[15]
M. Usama, M. Asim, S. Latif, J. Qadir et al., “Generative adversarial
networks for launching and thwarting adversarial attacks on network intrusion
detection systems,” in 2019 15th International Wireless Communications
& Mobile Computing Conference (IWCMC).1em plus 0.5em minus
0.4emIEEE, 2019, pp. 78–83.

[16]
Z. Lin, Y. Shi, and Z. Xue, “Idsgan: Generative adversarial networks
for attack generation against intrusion detection,” in Advances in
Knowledge Discovery and Data Mining, J. Gama, T. Li, Y. Yu, E. Chen,
Y. Zheng, and F. Teng, Eds.1em plus 0.5em minus 0.4emCham:
Springer International Publishing, 2022, pp. 79–91.

[17]
H. Zhang, X. Yu, P. Ren, C. Luo, and G. Min, “Deep adversarial learning in
intrusion detection: A data augmentation enhanced framework,” arXiv
preprint arXiv:1901.07949, 2019.

[18]
Q. Yan, M. Wang, W. Huang, X. Luo, and F. R. Yu, “Automatically synthesizing
dos attack traces using generative adversarial networks,”
International Journal of Machine Learning and Cybernetics, vol. 10,
no. 12, pp. 3387–3396, 2019.

[19]
C. Yin, Y. Zhu, S. Liu, J. Fei, and H. Zhang, “Enhancing network intrusion
detection classifiers using supervised adversarial training,” The
Journal of Supercomputing, pp. 1–30, 2019.

[20]
Y. Yin, Chuanlong Zhu, “An enhancing framework for botnet detection using
generative adversarial networks,” in 2018 International Conference on
Artificial Intelligence and Big Data (ICAIBD).1em plus 0.5em minus
0.4emIEEE, 2018.

[21]
A. Odena, C. Olah, and J. Shlens, “Conditional image synthesis with auxiliary
classifier gans,” in International conference on machine
learning.1em plus 0.5em minus 0.4emPMLR, 2017, pp. 2642–2651.

[22]
N. V. Chawla, K. W. Bowyer, L. O. Hall, and W. P. Kegelmeyer, “Smote:
synthetic minority over-sampling technique,” Journal of artificial
intelligence research, vol. 16, pp. 321–357, 2002.

[23]
G. Kovács, “An empirical comparison and evaluation of minority
oversampling techniques on a large number of imbalanced datasets,”
Applied Soft Computing, vol. 83, p. 105662, 2019.

[24]
N. Papernot, P. McDaniel, I. Goodfellow, S. Jha, Z. B. Celik, and A. Swami,
“Practical black-box attacks against machine learning,” in
Proceedings of the 2017 ACM on Asia Conference on Computer and
Communications Security.1em plus 0.5em minus 0.4emACM, 2017,
pp. 506–519.

[25]
G. Apruzzese, M. Andreolini, M. Marchetti, A. Venturi, and M. Colajanni, “Deep
reinforcement adversarial learning against botnet evasion attacks,”
IEEE Transactions on Network and Service Management, vol. 17, no. 4,
pp. 1975–1987, 2020.

[26]
E. B. Beigi, H. H. Jazi, N. Stakhanova, and A. A. Ghorbani, “Towards effective
feature selection in machine learning-based botnet detection approaches,” in
2014 IEEE Conference on Communications and Network Security.1em
plus 0.5em minus 0.4emIEEE, 2014, pp. 247–255.

[27]
D. Zhao, I. Traore, B. Sayed, W. Lu, S. Saad, A. Ghorbani, and D. Garant,
“Botnet detection based on traffic behavior analysis and flow intervals,”
Computers & Security, vol. 39, pp. 2–16, 2013.

[28]
A. Shiravi, H. Shiravi, M. Tavallaee, and A. A. Ghorbani, “Toward developing a
systematic approach to generate benchmark datasets for intrusion detection,”
computers & security, vol. 31, no. 3, pp. 357–374, 2012.

[29]
S. Garcia, “Malware capture facility project,” cvut, 2013.

[30]
R. K. Sharma, H. K. Kalita, and B. Issac, “Are machine learning based
intrusion detection system always secure? an insight into tampered
learning,” Journal of Intelligent & Fuzzy Systems, no. Preprint, pp.
1–17, 2018.

[31]
Y. LeCun, “The mnist database of handwritten digits,” http://yann.
lecun. com/exdb/mnist/, 1998.

[32]
Y. Guo, G. Xiong, Z. Li, J. Shi, M. Cui, and G. Gou, “Ta-gan: Gan based
traffic augmentation for imbalanced network traffic classification,” in
2021 International Joint Conference on Neural Networks (IJCNN).1em plus 0.5em minus 0.4emIEEE, 2021, pp. 1–8.

[33]
J. Lee and K. Park, “Ae-cgan model based high performance network intrusion
detection system,” Applied Sciences, vol. 9, no. 20, p. 4221, 2019.

[34]
R. Abou Khamis and A. Matrawy, “Evaluation of adversarial training on
different types of neural networks in deep learning-based idss,” in
2020 international symposium on networks, computers and communications
(ISNCC).1em plus 0.5em minus 0.4emIEEE, 2020, pp. 1–6.

[35]
Q. Cheng, S. Zhou, Y. Shen, D. Kong, and C. Wu, “Packet-level adversarial
network traffic crafting using sequence generative adversarial networks,”
arXiv preprint arXiv:2103.04794, 2021.

[36]
M. Abdelaty, S. Scott-Hayward, R. Doriguzzi-Corin, and D. Siracusa, “Gadot:
Gan-based adversarial training for robust ddos attack detection,” in
Ninth IEEE Conference on Communications and Network Security (IEEE CNS
2021), 2021.

[37]
C. P. X. Qui, D. H. Quang, P. T. Duy, V.-H. Pham et al., “Strengthening
ids against evasion attacks with gan-based adversarial samples in sdn-enabled
network,” in 2021 RIVF International Conference on Computing and
Communication Technologies (RIVF).1em plus 0.5em minus 0.4emIEEE, 2021, pp. 1–6.

[38]
U. Sabeel, S. S. Heydari, K. Elgazzar, and K. El-Khatib, “Cvae-an: Atypical
attack flow detection using incremental adversarial learning,” in 2021
IEEE Global Communications Conference (GLOBECOM).1em plus 0.5em minus
0.4emIEEE, 2021, pp. 1–6.

[39]
W. Li, X. Zhong, H. Shao, B. Cai, and X. Yang, “Multi-mode data augmentation
and fault diagnosis of rotating machinery using modified acgan designed with
new framework,” Advanced Engineering Informatics, vol. 52, p. 101552,

[40]
M. Frid-Adar, I. Diamant, E. Klang, M. Amitai, J. Goldberger, and H. Greenspan,
“Gan-based synthetic medical image augmentation for increased cnn
performance in liver lesion classification,” Neurocomputing, vol.
321, pp. 321–331, 2018.

[41]
X. Yi, E. Walia, and P. Babyn, “Generative adversarial network in medical
imaging: A review,” Medical image analysis, vol. 58, p. 101552, 2019.

[42]
A. Waheed, M. Goyal, D. Gupta, A. Khanna, F. Al-Turjman, and P. R. Pinheiro,
“Covidgan: data augmentation using auxiliary classifier gan for improved
covid-19 detection,” Ieee Access, vol. 8, pp. 91 916–91 923, 2020.

[43]
V. Chinbat and S.-H. Bae, “Ga3n: Generative adversarial autoaugment network,”
Pattern Recognition, p. 108637, 2022.

[44]
W. Jo and D. Kim, “Obgan: Minority oversampling near borderline with
generative adversarial networks,” Expert Systems with Applications,
p. 116694, 2022.

[45]
A. Madhu and S. K., “Envgan: a gan-based augmentation to improve environmental
sound classification,” Artificial Intelligence Review, Feb 2022.
[Online]. Available: <https://doi.org/10.1007/s10462-022-10153-0>

[46]
S. Grierson, C. Thomson, P. Papadopoulos, and B. Buchanan, “Min-max training:
Adversarially robust learning models for network intrusion detection
systems,” in 2021 14th International Conference on Security of
Information and Networks (SIN), vol. 1.1em plus 0.5em minus
0.4emIEEE, 2021, pp. 1–8.

[47]
S. Zhao, J. Li, J. Wang, Z. Zhang, L. Zhu, and Y. Zhang, “attackgan:
Adversarial attack against black-box ids using generative adversarial
networks,” Procedia Computer Science, vol. 187, pp. 128–133, 2021.

[48]
S. Suh, H. Lee, P. Lukowicz, and Y. O. Lee, “Cegan: Classification enhancement
generative adversarial networks for unraveling data imbalance problems,”
Neural Networks, vol. 133, pp. 69–86, 2021.

[]Rizwan Hamid Randhawa received a BS degree in Electronic Engineering from International Islamic University Islamabad, Pakistan in 2008 and Master in Computer Science from Information Technology University, Lahore, Pakistan in 2017. He has vast experience with embedded systems in Pakistan's private and public sector organisations. He is pursuing his PhD in Computer Science from Northumbria University, Newcastle upon Tyne, UK. His research interests include AI-based botnet detection, IoT Security and Embedded Systems Design & Development for IoT platforms.

[]Nauman Aslam is a Professor in the Department of Computer and Information Science, Northumbria University, UK. Before joining Northumbria University as a Senior Lecturer in 2011, he worked as an Assistant Professor at Dalhousie University, Canada. He received his PhD in Engineering Mathematics from Dalhousie University, Canada, in 2008. Dr Nauman leads the Network Systems and Security research group at Northumbria University. His research interests cover diverse but interconnected areas related to communication networks. His current research focuses on addressing wireless body area networks and IoT, network security, QoS-aware communication in industrial wireless sensor networks, and Artificial Intelligence (AI) application in communication networks. He has published over 100 papers in peer-reviewed journals and conferences. Dr Nauman is a member of IEEE.

[]Mohammed Alauthman received his PhD degree in Network Security & Botnet Detection from Northumbria University Newcastle, the UK, in 2016. He received a B.Sc. degree in Computer Science from Hashemite University, Jordan, in 2002, and an M.Sc. degree in Computer Science from Amman Arab University, Jordan, in 2004. Currently, he is Assistant Professor at the Information Security Department, Petra University, Jordan. His research interests include Cyber-Security, Cyber Forensics, Advanced Machine Learning and Data Science applications.

[]Husnain Rafiq received the B.S. and M.S. degrees in Computer Science from the Capital University of Science and Technology, Islamabad, Pakistan in 2015 and 2017, respectively. From 2015 to 2018, he was a Jr. Lecturer with the Capital University of Science and Technology, Islamabad, Pakistan. He is pursuing a PhD from Northumbria University Newcastle upon Tyne, UK in Android Malware Detection. His area of research includes Information Security and Forensics, Machine learning and Malware Analysis.