Next Article in Journal
Reactive Shield for Reducing the Magnetic Field of a Wireless Power Transfer System with Dipole Coil Structure
Previous Article in Journal
Ship Network Traffic Engineering Based on Reinforcement Learning
Previous Article in Special Issue
A Data Sharing Model for Blockchain Trusted Sensor Leveraging Mimic Hash Mechanism
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Reinventing Web Security: An Enhanced Cycle-Consistent Generative Adversarial Network Approach to Intrusion Detection

1
School of Cyber Science and Engineering, University of International Relations, Beijing 100091, China
2
Marine Engineering of College, Dalian Maritime University, Dalian 116026, China
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Electronics 2024, 13(9), 1711; https://doi.org/10.3390/electronics13091711
Submission received: 26 March 2024 / Revised: 23 April 2024 / Accepted: 25 April 2024 / Published: 29 April 2024
(This article belongs to the Special Issue Applied Cryptography and Practical Cryptoanalysis for Web 3.0)

Abstract

:
Web3.0, as the link between the physical and digital domains, faces increasing security threats due to its inherent complexity and openness. Traditional intrusion detection systems (IDSs) encounter formidable challenges in grappling with the multidimensional and nonlinear traffic data characteristic of the Web3.0 environment. Such challenges include insufficient samples of attack data, inadequate feature extraction, and resultant inaccuracies in model classification. Moreover, the scarcity of certain traffic data available for analysis by IDSs impedes the system’s capacity to document instances of malicious behavior. In response to these exigencies, this paper presents a novel approach to Web3.0 intrusion detection, predicated on the utilization of cycle-consistent generative adversarial networks (CycleGANs). Leveraging the data transformation capabilities of its generator, this method facilitates bidirectional conversion between normal Web3.0 behavioral data and potentially intrusive behavioral data. This transformative process not only augments the diversity and volume of recorded intrusive behaviors but also clandestinely simulates various attack scenarios. Furthermore, through fostering mutual competition and learning between the discriminator and generator, the approach enhances the ability to discern the defining characteristics of potential intrusive behaviors, thereby bolstering the accuracy of intrusion detection. To substantiate the efficacy of the CycleGAN-based intrusion detection method, simulation experiments were conducted utilizing public datasets, including KDD CUP 1999 (KDD), CIC-DDOS2019, CIC-IDS2018, and SR-BH 2020. The experimental findings evince the method’s remarkable accuracies across the four datasets, attaining rates of 99.81%, 97.79%, 89.25%, and 95.15%, respectively, while concurrently maintaining low false-positive rates. This research contributes novel insights and methodologies toward the advancement of Web3.0 intrusion detection through the application of CycleGAN technology, which is poised to play a pivotal role in fortifying the security landscape of Web3.0.

1. Introduction

As one of the most significant technological trends of the 21st century, Web3.0 has profoundly impacted human life and work. With the interconnection of various physical devices, sensors, and embedded systems, we have entered a new digital era where the interaction of smart devices and data sharing have become crucial. The essence of Web3.0 lies in its decentralization and the concept of user-controlled data, making data security and privacy protection focal points. However, the rapid development of Web3.0 has also brought about a series of serious security challenges, necessitating continuous exploration of innovative solutions to ensure its sustainable development and security [1].
The SolarWinds supply chain attack was one of the most notable events between 2020 and 2021, affecting thousands of companies and government organizations. Hackers successfully infiltrated many customers’ network systems by tampering with SolarWinds’ software updates. This event serves as a significant warning for the security of Web3.0. While Web3.0’s decentralized nature and smart contracts offer innovative potential, they also bring new security challenges.
Web3.0 encompasses decentralized networks, smart contracts, digital assets, and other areas, facing various security challenges including, but not limited to, the security of decentralized networks, smart contract vulnerabilities, the secure management of digital assets, and supply chain attacks [2]. Therefore, the demand for Web3.0 security technologies continues to grow. By integrating intrusion detection technologies, potential intrusions and attacks in Web3.0 networks can be effectively monitored and defended against. This integration enables Web3.0 networks to better protect user data, smart contracts, and digital assets, thereby enhancing network security and trustworthiness [3]. Currently, cutting-edge security technologies include blockchain [4], edge computing [5], threat intelligence [6], and intrusion detection techniques. intrusion detection systems (IDSs) can monitor sensitive data [7], prevent the leakage of private data, detect DoS attacks [8], and reduce the risks of data misuse [9] and privacy violations [10].
Intrusion detection systems are crucial in today’s Web security field for monitoring and identifying potential network intrusions and security threats. Although intrusion detection technologies have made significant progress in recent decades, they still face multiple challenges and limitations that affect performance, accuracy, and availability. False positives and false negatives [11] frequently occur, reducing the credibility and effectiveness of the system. Traditional intrusion detection systems typically rely on known attack patterns and signatures to detect threats, but zero-day vulnerabilities and advanced persistent threats (APTs) use new attack methods [12], making it difficult for traditional approaches to identify these threats. To address these issues, machine learning and deep learning techniques have been introduced to improve the accuracy and adaptability of intrusion detection systems to better handle diverse threats.
This research proposes a Web intrusion detection system based on cycle-consistent adversarial network models [13], which have outstanding capabilities in anomalous traffic detection and data augmentation. The model maps the process of data anomalies caused by network traffic attacks to the generator’s process of converting normal data into anomalous data, achieving the goal of data augmentation. Meanwhile, the adversarial learning between the discriminator and generator improves the discriminator’s ability to identify anomalous data.
Experiments have verified that the proposed method can accurately detect various attacks on the Web. We evaluated the model on the KDD99 [14], CIC-IDS2018 [15], CIC-DDOS2019 [16], and SB-RH 2020 [17] datasets. On the KDD99 dataset, the model achieved a high accuracy of 99.81%; on the CIC-DDOS2019 dataset, the accuracy reached 97.79%; on the CIC-IDS2018 dataset, it was 89.25%; and on the SR-BH 2020 dataset, it was 95.15%. The results demonstrate that compared to LSTM, RNN, MLP, and other deep learning models, this model significantly improves performance.
The main contributions of this paper are as follows:
(1) Network traffic analysis is often limited by insufficient attack samples. To address this data scarcity issue, this model introduces cycle-consistent adversarial networks (CycleGAN) to convert data across domains. In attack detection tasks, normal network traffic and malicious attack traffic are viewed as two domains, and CycleGAN enables mutual conversion between them to generate more training samples. In this way, the training dataset is effectively expanded, improving the model’s generalization capability.
(2) CycleGAN is utilized not only for data augmentation, but also for feature learning and transfer. This model trains a CycleGAN model to convert normal traffic into feature representations of malicious traffic, then uses these feature representations to train the intrusion detection model. This allows the model to learn richer features from malicious traffic and improves detection performance.
(3) For novel attacks with unknown attack patterns and signatures, such as zero-day vulnerabilities and advanced persistent threats (APTs), the discriminator of this model can distinguish between normal network traffic and unknown attack traffic by learning the characteristics of normal traffic.
(4) The methodology proposed in this paper exhibits excellent performance. Simulation experiments were conducted using public datasets, namely KDD CUP 1999 (KDD), CIC-DDOS2019, CIC-IDS2018, and SR-BH 2020. The experimental results demonstrate high accuracy rates on these datasets, reaching 99.81%, 97.79%, 89.25%, and 95.15%, respectively, with concurrently low false-positive rates.
The remainder of this paper is organized as follows: Section 2 will elaborate on the background and motivations of this research in detail to highlight the rationale behind the CycleGAN-based intrusion detection method. Section 3 will introduce the proposed methods in detail, including the technical details of CycleGAN-based data augmentation and feature learning, as well as attack detection methods. Section 4 will present the experimental results, comprehensively evaluating the performance of the CycleGAN-based intrusion detection system in depth and comparing it with traditional methods. Finally, Section 5 concludes the paper, objectively summarizing the limitations, contributions, and future research directions.

2. Background and Related Work

2.1. DNN and CycleGAN

Deep neural networks (DNNs) are a biologically inspired machine learning model that mimic biological neural networks. They consist of multiple stacked layers of neural units, with each layer containing multiple neurones interconnected through adjustable weight connections. The early origins of neural networks can be traced back to the 1950s–1960s, including Frank Rosenblatt’s perceptron [18] and Marvin Minsky and Seymour Papert’s research on the limitations of perceptrons [19]. However, progress on early DNNs was limited until Yann LeCun proposed the convolutional neural network (CNN) model LeNet-5 in 1998 [20], which was trained using backpropagation. However, DNNs underperformed compared to traditional machine learning algorithms and training deep networks was challenging. In 2012, Alex Krizhevsky’s AlexNet [21] marked a major breakthrough for DNNs, successfully introducing deep neural networks to the field of image recognition and completely transforming the field. AlexNet overturned traditional image classification, and DNNs started to emerge, followed by many network architectures like VGGNet [22], GoogleNet [23], and ResNet [24]. These models have superior classification capabilities, and are used to analyze network traffic to identify malicious attacks, such as Swarna Priya R.M. et al. [25] using deep neural networks to classify and predict unknown network attacks.
Since they were first proposed in 2014, generative adversarial networks (GANs) [26] have been widely applied in anomaly detection. GANs are a deep learning model composed of a generator and discriminator that compete with each other, continuously adjusting parameters so the generator can produce more realistic data to improve the discriminator’s accuracy. In 2016, researchers proposed the pix2pix model [27], which utilizes adversarial training similar to GANs and can convert input images to associated output images, such as converting line drawings to colored images. However, pix2pix requires paired training data, making it unsuitable for some cases. The key innovation of cycle-consistent GANs (CycleGAN) is the ability to achieve unpaired cross-domain image translation, converting images from one domain to another without paired datasets. Compared to DiscoGAN [28], proposed in the same year, which can also perform cross-domain translation, DiscoGAN requires paired training data. In addition to anomaly detection capabilities, CycleGAN has the unique ability of data-type conversion. CycleGAN represents an important milestone in the development of GANs, enabling more practical and efficient data-type conversion through continuous improvements and optimizations. Compared to other deep learning models, such as LSTM, AE [29], CNN, and GCN [30], which can also be used for anomaly detection tasks, CycleGAN also enables exceptional cross-domain conversion.

2.2. Intrusion Detection Based on Deep Learning

The concept of intrusion detection was first proposed by James Anderson [31] in 1980, who described a method to monitor and detect anomalous activities in computer systems, which can be seen as an early intrusion detection system prototype. Another early work was the host-based intrusion detection model proposed by Dorothy Denning [32] in 1987, which focused on detecting abnormal or anomalous behaviors in computer systems.
In the 1990s, researchers began to use traditional neural networks such as MLPs [33] for anomaly detection in networks. With the rise in deep learning, the performance of deep neural network-based intrusion detection systems has greatly improved and has become a major approach. In recent years, many deep neural network intrusion detection systems have emerged, such as the system by Ghulam Muhammad et al. [34], which combines autoencoders and deep neural networks, learns features unsupervised, and then, supervised, trains the DNN to extract deep features for classification.
Yanqing Yang et al. [35] proposed the SAVAER-DNN intrusion detection model, using the SAVAER decoder, to generate low-frequency and unknown attack samples, increasing data diversity and balancing the dataset. The model can detect both known and unknown attacks, improving the detection rate for low-frequency attacks. Neelu Khare et al. [36] combined deep learning and machine learning, improving detection performance by optimizing the dataset. Chaofei Tang et al. [37] proposed the SAAE-DNN intrusion detection model, using the SAAE encoder to automatically extract features and initialize DNN weights, improving detection accuracy.
Mohammad Al-Fawareh et al. [38] proposed the PCA-DNN model to detect anomalous network behaviors, addressing issues like high false alarm rates, long detection times, and zero-day attacks. Ankit Thakkar et al. [39] analyzed the impact of L 1 , L 2 , elastic net regularization and dropout techniques on DNN intrusion detection performance. K. Narayana Rao et al. [40] proposed a two-stage hybrid approach, where in the first stage L 1 regularization sparsifies the autoencoder, and in the second stage the DNN predicts and classifies attacks, achieving high detection rates.
E. Balamurugan et al. [41] proposed the IDSGT-DNN framework, which incorporates attacker and defender mechanisms to process attack and normal data. Ankit Thakkar et al. [42] proposed a new feature selection technique by integrating differences, fusing the differences between standard deviation, mean, and median to improve DNN-IDS performance. The following year, Ankit Thakkar et al. [43] used a machine learning-driven deep neural network to classify unbalanced intrusion data, addressing the class imbalance issue in intrusion detection datasets.
Since its advent in 2014, generative adversarial networks (GANs) have gained much attention; although initially used for image tasks, they have expanded into multi-disciplinary research. In network security, they are especially used for intrusion detection tasks dealing with imbalanced datasets [44]. As data samples are mostly imbalanced in most cases, causing intrusion detection models to be biased towards majority classes, to address this, Vikash Kumar et al. [45] proposed a Wasserstein conditional GAN (WCGAN) combined with an XGBoost classifier. They used gradient penalty with WCGAN to stabilize model training, enabling the model to generate highly similar minority class samples.
Recent related research shows that, on the one hand, some researchers adopt deep neural networks (DNNs) to analyze Web3.0 network traffic to improve the ability of intrusion detection systems to distinguish between normal and malicious traffic. On the other hand, researchers combine machine learning and deep learning algorithms to improve detection performance. In addition, some researchers focus on techniques like regularization and dropout to improve DNN model performance. Finally, to address imbalanced dataset issues, some researchers use generative adversarial networks (GANs) to simultaneously handle sample generation and attack behavior detection. The explanation table for the relevant work is shown in Table 1.

3. Intrusion Detection Framework

In this section, we will introduce the intrusion detection framework proposed in this paper and its functionality in the context of Web3.0. Web3.0 applications involve interactions with decentralized networks, smart contracts, and digital assets, which generate network traffic that may contain malicious payloads. The model proposed in this paper analyzes this Web3.0 traffic by extracting features, performs data augmentation, and detects malicious activities. The reference architecture of the intrusion detection model for Web3.0 proposed in this paper is as shown in Figure 1.

3.1. Dataset Definition

In this paper, normal data are defined as the source domain, represented by dataset X : x i i = 1 N ; anomalous data are defined as the target domain, represented by dataset Y : y j j = 1 M . Taking the KDD99 dataset as an example, data with the normal label are considered the source domain, data with the Back attack-type label are considered the target domain, and data of other attack types are considered other domains, represented by the Other dataset: other i i = 1 N .

3.2. Cycle-Consistent Generative Adversarial Network

The intrusion detection model proposed in this research is based on an unsupervised learning method, using cycle-consistent adversarial networks (CycleGANs). CycleGAN is an image-to-image translation method that does not require paired training data. For given datasets from two domains, CycleGAN can translate between the two domains without needing to match data pairs one-to-one. It works by learning to map data from one domain to the other, and then back to the original domain, while preserving consistency between the original data and reconstructed data. This adversarial generative network-based technique enables CycleGAN to achieve high-quality cross-domain data translation. Due to its superior generalization even on small datasets, it can outperform traditional methods. In this paper, we apply this method to attack-type conversion, translating normal data to anomalous data, in order to effectively augment the dataset.
L GAN G , D Y , X , Y is the generator loss, L GAN F , D X , Y , X is the discriminator loss, and L cyc ( G , F ) is the cycle consistency loss in the overall objective function of the cycle-consistent adversarial network:
L G , F , D X , D Y = L GAN G , D Y , X , Y + L GAN F , D X , Y , X + λ L cyc ( G , F )

3.3. Intrusion Detection Network Model

The cycle-consistent adversarial network in this paper consists of two discriminators and two generators, all implemented using the same multilayer perceptron (MLP) network structure for training. The generator includes three hidden layers with 128, 256, and 512 neurons, respectively, and the input and output layers have equal numbers of neurons. The discriminator has two hidden layers with 512 and 256 neurons, respectively, and the output layer has 1 neuron. The two generators achieve data translation from the source domain to the target domain and vice versa. The two discriminators judge whether the data belong to the source or target domain.
In this paper, the intrusion detection dataset is divided into normal traffic dataset X : x i i = 1 N and anomalous traffic dataset Y : y j j = 1 M , which have a non-paired relationship. The goal of the network model is to learn a mapping G X Y : X Y so that the generator can continuously optimize to eventually translate samples X to Y; meanwhile, it learns an inverse mapping D G Y X : Y X to reconstruct X from Y, G Y X G X Y ( X ) X . Discriminators D X and D Y are introduced, where D X distinguishes between data { x } and G Y X ( y ) , and D Y distinguishes between { y } and G X Y ( x ) . To ensure that the core content is transferred during translation instead of just the type, a cycle consistency loss function L cyc G X Y , G Y X is added to preserve the key information of X. Data from other domains do not participate in the translation, and discriminators E and F distinguish target domain data from other domain data by learning the features of Other: other i i = 1 N . The model training process is illustrated in Figure 2.
The mean squared error (MSE) and L 1 loss functions are used in this paper. MSE is a commonly used loss function in regression tasks that measures the average squared difference between the predicted and actual values. A lower MSE value indicates smaller differences between predicted and true values, and better model performance.
MSE = 1 n x i y i 2
The L 1 loss function is known as minimizing absolute error. It has good robustness and is not overly affected by data with large errors. In this paper, the cycle consistency loss function L cyc is represented using the L 1 loss function.
MAE = 1 n x i y i
While the generators translate between the target and source domains, the key information should not be lost. Therefore, this paper chooses to train the two generators together with the cycle consistency loss function.
L G G X Y , G Y X , D X , D Y = MSE D X G Y X ( y ) , 1 + MSE D Y G X Y ( x ) , 1 + MAE G Y X G X Y ( x ) , x + MAE G X Y G Y X ( y ) , y
The loss function of discriminator D X is used to train discriminator D X ’s ability to distinguish between normal data and data of other types.
L D X = MSE D X ( x ) , 1 + MSE D X ( y ) , 0 + MSE D X G Y X ( y ) , 0 + MSE D X ( other ) , 0
The loss function of discriminator D Y is used to train discriminator D Y ’s ability to distinguish between anomalous data and data of other types.
L D Y = MSE D Y ( y ) , 1 + MSE D Y ( x ) , 0 + MSE D Y G X Y ( x ) , 0 + MSE D Y ( other ) , 0
Through this method, the ability of generator G X Y ( x ) to convert normal data into anomalous data can be enhanced, thereby expanding the anomalous data training set. At the same time, it also enhances generator G Y X ( y ) ’s ability to convert anomalous data into normal data, expanding the normal dataset.
After training, discriminators D X and D Y can distinguish between normal and anomalous data on the test set. For test data, discriminators D X and D Y are used to judge the category of traffic data, respectively. If D X data > D Y data , the data are judged as normal; if D X data < D Y data , they are judged as anomalous.
As indicated in the Algorithm 1 provided, before inputting data into the model, the training set is first divided into normal data X : { x i } i = 1 N , a specific type of anomaly data Y : { y i } j = 1 N , and other types of anomaly data { o t h e r i } i = 1 N . Then, the generator G X Y , inverse mapping G Y X ( y ) , and discriminators D X and D Y are defined. The dataset is then fed into the model, where the parameters of generators G X Y and G Y X ( y ) are optimized using optimizer L G , and the parameters of discriminators D X and D Y are optimized using loss functions L G X and L G Y . In step 2, two already trained generators are used for data augmentation to expand the dataset. In step 3, the trained dataset is used for data classification, where if D X ( D a t a ) > D Y ( D a t a ) , the data are classified as normal; if D X ( D a t a ) < D Y ( D a t a ) , they are classified as anomalous data.
Algorithm 1 CycleGANIDS Data training
1:
Input: X and Y, Other ( X : x i i = 1 N , Y : y j j = 1 N , other i i = 1 N )
2:
Train: Generator G X Y , Inverse mapping G Y X ( y ) , Determiner ( D X and D Y )
3:
Step1 Training network
4:
while  i < iterations do
5:
Optimize the parameters of generators G X Y and G Y X ( y ) : L G ( G X Y , G Y X , D X , D Y )
6:
Optimize the parameters of discriminator D X : L D X
7:
Optimize the parameters of discriminator D Y : L D Y
8:
end while
9:
Step2 Using generative networks for data augmentation and expansion of datasets
g _ b a c k = G X Y ( x ) , g _ n o r m a l = G Y X ( y ) ,
10:
Step3 Use judgment network
11:
When data are fed into the discriminator, if D X > D Y the data are normal, if D X < D Y the data are anomalous.

3.3.1. Data Augmentation of the Model

Data augmentation refers to techniques that transform or make small modifications to existing data to synthesize new data, thereby expanding the dataset capacity. Data augmentation is commonly used to alleviate insufficient data issues in deep learning, and has been widely applied in image and natural language processing, expanding to intrusion detection [46]. Domestic and foreign researchers have adopted various data augmentation techniques, such as adding noise, rotating, flipping, cropping images, etc. [21]. However, existing methods are limited to processing image and speech data, and cannot effectively expand network traffic data.
To address the above issues, the model proposed in this research adopts CycleGAN technology to achieve conversion from normal traffic to attack traffic, thereby generating more diverse attack data. This method not only expands the dataset scale, but also enhances the model’s ability to detect new attacks. The inspiration comes from the infection mechanism of computer viruses [47]: after being infected, the computer loses normal functionality due to some reason and is controlled by the virus to attack other computers, but can resume normal operation after cleanup. Similarly, this paper maps the “infection” and “cleanup” processes to generators D X and D Y . Generator D X can infect normal data to expand the anomalous dataset, while inverse generator D Y can purify anomalous data to generate new normal data, expanding the normal dataset. This traffic conversion based on adversarial networks can effectively augment the data needed for intrusion detection systems. The data augmentation process is illustrated in Figure 3.

3.3.2. Model Discrimination

Intrusion detection is the core functionality of the model in this paper, and it is used to monitor and detect potential intrusive behaviors. As an active security protection technology, intrusion detection can monitor internal attacks, external attacks, and misoperations in real time and take interception and response measures before the network system is threatened.
The discrimination process of this model has two approaches. The first approach is used to distinguish between a single attack type and normal data, for example, training a single discriminator to differentiate between normal data and Back attack, or between normal data and Pod attack. The second approach involves training multiple discriminators, with each discriminator corresponding to one attack type. Then, unknown data are fed sequentially into the multiple discriminators, and the discriminator associated with the maximum value is output, thereby determining the attack type of the unknown traffic.
(1)
Single-category attack detection
For detecting a single type of attack traffic, such as backdoor attack, the model trains an adversarial discriminator D y . The discrimination objective of D y is to distinguish between normal traffic X and anomalous traffic Y, where Y refers specifically to backdoor attack traffic. Through adversarial learning, D y obtains feature expressions of normal traffic to identify differences between normal traffic X and traffic Y containing backdoor attack features. After training, D y can discriminate new unknown network traffic, judging whether anomalous backdoor attack features exist based on its determination.
(2)
Multi-classification attack detection
For detecting multiple types of attacks, the model trains multiple adversarial discriminators { D 1 , D 2 , D n } , with each discriminator D i corresponding to a known attack type Y i . During testing, new unknown network traffic is fed sequentially into each adversarial discriminator D i for judgement. The discrimination probabilities of different D i s are compared, and the attack type corresponding to the discriminator with maximum probability Pmax is selected as the most likely attack type for that traffic flow. The detection process is illustrated in Figure 4.
By training discriminators that distinguish between normal traffic and various attack traffic types, the model can detect known and zero-day attacks that may exist in unknown traffic. Compared to simply matching attack signatures, this adversarial deep learning discriminator-based approach can better detect complex network intrusion behaviors.
Suppose a cloud service provider is under a DDoS attack. Attackers use a large number of zombie computers to send a massive amount of malicious traffic to the servers of the cloud service provider, exhausting the bandwidth and resources of the servers and preventing normal users from accessing the cloud service. A CycleGAN-based intrusion detection system can be employed to detect such DDoS attacks. The system initially monitors and analyzes the traffic entering the network of the cloud service provider in real time. It utilizes a pre-trained discriminator to classify the traffic, distinguishing between normal and anomalous traffic.
In this scenario, the traffic sent by the attackers might exhibit certain characteristics, such as a high volume of requests from geographically diverse IP addresses, abnormally high request frequencies, and targets concentrated on specific services or ports. The system uses the discriminator model to recognize and analyze these features, identifying traffic that may likely be part of a DDoS attack.
Furthermore, the system can collect anomalous traffic, capturing its characteristics, and through CycleGAN’s data augmentation transformation technology, learn the features of similar anomalous traffic for better future detection and analysis.
Once the system detects an abnormal traffic pattern, it immediately takes measures to address it. For example, the system can automatically tag the attacking traffic, diverting it to a dedicated firewall or traffic scrubbing equipment for further analysis and mitigation. Additionally, the system can alert network administrators and record detailed information about the attack for subsequent investigation and analysis.

4. Performance Analysis

In this section, we mainly discuss the experiments we conducted to verify the binary anomalous detection capabilities of the intrusion detection model. In the experiments, three public datasets, including KDD, CIC-DDOS2019, CIC-IDS2018 and SR-BH 2020, were used, and the data preprocessing process is shown in detail. Next, the metrics used to evaluate model performance are introduced, and the performance results of the model are presented. Finally, through comparison with the experimental results of LSTM, CNN, MLP, and other models, the superiority of this model in performance is validated.

4.1. Dataset

The first evaluation dataset used in this experiment is from the Third International Knowledge Discovery and Data Mining Tools Competition in 1999, which aimed to build robust intrusion detection systems. The dataset simulates 9 weeks of network connection and system audit data to mimic various user types and different network traffic and attack methods, making it close to real network environments. The dataset contains four anomaly types: DOS, Probing, R2L, and others. Each traffic sample has 41 features, where 1–9 represent basic TCP connection features, 10–22 are content features of TCP connections, 23–31 are time-based network traffic statistical features calculated within a 2 s time window, and 32–41 are host-based network traffic statistical features used to evaluate attacks lasting more than two seconds, as shown in Figure 5.
The second evaluation dataset used in this experiment is the CIC-IDS2018 dataset (2018 Intrusion Detection Evaluation Dataset) developed by the Canadian Institute for Cybersecurity (CIC). The dataset provides raw data (PCAPs) as well as network traffic analysis results based on timestamps, source IP, destination IP, source port, destination port, protocol, and attack labels. The dataset includes abstracted behavior of twenty-five users, based on HTTP, HTTPS, FTP, SSH, and email protocols. Brute force attack types include FTP, SSH, DoS, Heartbleed, Web, infiltration, botnet, and DDoS. The table summarizes the traffic information recorded each day. In this study, only samples from the Friday—2 March 2018, Wednesday—14 February 2018, and Friday—16 February 2018 datasets were used for analysis, as shown in Table 2 [48].
The third evaluation dataset used in this experiment is the recently released CIC-DDoS2019 DDoS evaluation dataset (2019) from the Canadian Institute for Cybersecurity (CIC). The dataset underwent network traffic analysis using the CICFLOWMeter-V3 tool, and the results contain traffic tokens based on timestamps, source IP, destination IP, etc. The dataset covers various types of DOS attacks found in real network environments, including LDAP, MSSQL, NetBIOS, Portmap, SYN, UDP, and UDALag, with a total of 88 features. The CIC-DDoS2019 dataset is publicly available on the Canadian Institute for Cybersecurity website in PCAP and CSV flow format, and can be used to evaluate the ability to detect the latest DDoS attacks, as shown in Figure 6.
The final dataset utilized in this experiment is the SR-BH 2020 dataset, which is designed to test and evaluate different algorithms and models. This dataset consists of Web requests collected from a Wordpress Web server installed on a virtual machine and exposed to the Internet during the period of 12 July 2020. It is a specialized multi-label dataset for Web attack detection, comprising 907,814 requests, of which 525,195 are normal requests and 382,619 are anomalous requests. Each record includes 24 distinct features and a set of 13 labels. Table 3 below provides detailed information about the classification of Web requests under specific CAPEC categories.

4.2. Data Preprocessing

Before model training, training sets for three datasets need to be properly processed to improve model performance. Specifically, character features first need to be processed, since character data cannot be directly input into neural networks, such as the “LDAP” in labels and “xxx-xxx-xxx” in time features. Next, numerical data are normalized.
1. The KDD99 and CICDDOS2019 datasets have 41 and 88 features, respectively, with the final label features being character type. For ease of neural network training, these label features need to be removed or converted to the numeric type. The CICIDS2018 dataset has a timestamp as the third feature, containing the year, month, and day, so this character feature was removed in this experiment.
2. Before data modeling and analysis, data are usually standardized to eliminate the influence of different feature dimensions, and the standardized data are used for analysis. The purpose of standardization is to make each feature have similar magnitudes and be dimensionless. Data normalization is mainly used to solve the problem of features with different properties, because directly summing indicators of different properties cannot correctly reflect their combined effect. Through standardization, the data properties of different features can be adjusted to make their impacts on the evaluation results more consistent, in order to obtain the correct model.
x = x x ¯ σ
3. Before data analysis, normalization is also required to map feature values into the range of 0–1, in order to compare and weight features of different magnitudes. Normalization is a method to simplify computation by transforming the original dimensional expression into a dimensionless expression, making it a pure quantity. This helps process features with different units or magnitudes for unified calculation and analysis.
x = x min ( x ) max ( x ) min ( x )

4.3. Evaluation Indicators

This paper adopts six performance metrics—precision, recall, F1-score, accuracy, false-negative rate (FNR), and false-positive rate (FPR)—to evaluate model performance. These metrics are calculated based on four measurements: true positive (TP), true negative (TN), false positive (FP), and false negative (FN):
True Positive (TP): correctly predict positive samples as positive classes.
True Negative (TN): correctly predict negative samples as negative classes.
False Positive (FP): mispredict negative samples as positive classes.
False Negative (FN): mispredict positive samples as negative classes.
The calculation formula for accuracy is the proportion of correctly predicted samples to the total number of samples:
Accuracy = T P + T N T P + F P + T N + F N
The calculation formula for accuracy is the proportion of correctly predicted samples to the total number of samples:
Precision = T P T P + F P
The recall rate refers to the probability of correctly predicting positive samples among all positive samples, which is the ratio of correctly predicting the number of positive samples to all positive samples. It reflects the proportion of actual positive classes predicted as positive classes, and its formula is as follows:
Recall = T P T P + F N
The F1-score is a metric used in statistics to measure the accuracy of binary classification (or multi-task binary classification) models. It takes into account both the precision and recall of the classification model.
F 1 - score = 2 × Precision × Recall Precision + Recall
The false-negative rate (FNR) and false-positive rate (FPR) are important metrics to measure the performance of intrusion detection systems. The FNR refers to the probability that the system mistakenly identifies normal behavior as intrusive under normal conditions. The FPR refers to the probability that the system fails to correctly identify intrusive behavior when intrusion is present.
FNR = F N T P + F N = 1 Precision FPR = F P T P + F P = 1 Recall

4.4. Experimental Analysis

We divided the dataset’s normal and abnormal samples into training, validation, and testing sets, respectively, with the number of abnormal samples being the same as the number of normal samples. The test set and training set in this study were both obtained through random sampling from the KDD99, CIC-IDS2018, CIC-DDOS2019, and SR-BH 2020 datasets. For each training, a specific number of anomalous samples and the same number of normal samples were randomly selected from the training set for model training, while the validation set was used to fine-tune model parameters, and finally the test set was used to evaluate model performance. For example, 3000 “Neptune” attack samples and 3000 “normal” samples were used to train the model, improving the model’s ability to detect neptune attacks and perform normal–anomalous data conversion. Then, 500 “normal” samples and 500 “neptune” samples were extracted as the test set to evaluate model performance, as shown in Table 4, Table 5, Table 6 and Table 7.
Through multiple experiments adjusting different parameters, the optimal model parameter settings were obtained. During the experiments, it should be noted that due to the different feature dimensions of the three datasets, the number of neurons in the model’s input layer needed to be adjusted accordingly before model training. For the KDD99, CIC-IDS2018, CIC-DDOS2018, and SR-BH 2020 datasets, the input layer dimensions of the model were set to 41, 76, 79, and 20, respectively. Next, the generators and discriminators of the model were trained and tested for performance. The results found that when the sample size was greater than 1500, a batch size of 64 gave the optimal model performance; otherwise, a batch size of 32 was better, as shown in Table 8.
The experiments discovered that high-quality discriminators and generators can provide high-quality feature expressions to improve model computation speed and avoid gradient vanishing. Relu activation functions were used between the hidden layers of the discriminators and generators. Through multiple experiments adjusting the number of hidden layers, the results showed that four layers for the generator and three layers for the discriminator achieved the best balance between accuracy and computational resources.
Taking the KDD99 dataset as an example, this study experimented with the relationship between discriminator and generator performance and the number of network layers under different batch sizes. The results show that when the batch size is 16, 32, and 64, the generator with four layers and the discriminator with three layers strike the most suitable balance between accuracy and efficiency in terms of network structure selection, as shown in Figure 7.

4.5. Experimental Result

First, this model was used to detect single anomaly types in the KDD99 and CIC-DDOS2019 datasets to evaluate model performance in anomalous sample identification and data augmentation. The results show that the model demonstrated good performance in detecting various anomaly types. On the KDD99 test set, the model accuracy (ACC) reached 100% at best, indicating perfect detection capability, while the lowest was 98.23% for nmap attack detection. On the CIC-DDOS2018 test set, the lowest detection accuracy of the model was 94.5% for SYN attack detection, while the highest was 99.81% for LDAP attack detection. However, on the ICI-IDS2018 test set, the model performed relatively poorly. Although precision reached 100%, the recall and overall accuracy (ACC) were only about 93% for FTP-Bruteforce attack detection, as shown in Table 9, Table 10 and Table 11.
As shown in Table 12, our model conducted experiments on the SR-BH 2020 dataset targeting classical Web attacks. Due to the limited number of instances for labels such as Dictionary-based Password Attack, Scanning for Vulnerable Software, Input Data Manipulation, and HTTP Request Smuggling, each with fewer than 3000 instances, the test set for each label comprised 500 samples. The model performed exceptionally well for the single-label CAPEC classification within the SR-BH 2020 dataset. For most categories, it achieved extremely high levels of accuracy, precision, recall, F1-score, and MCC value, with some categories even reaching perfect scores. This indicates that the model possesses robust capability to identify and classify various attack patterns, achieving a good balance between precision and comprehensiveness. Overall, the model demonstrated satisfactory results in the single-label CAPEC classification task, providing reliable tools and support for attack detection and defense in the security domain.
In addition, binary classification experiments were conducted on the KDD99, CIC-IDS2018, and CIC-DDOS2019 datasets using this model, and performance was compared with mainstream deep learning models like LSTM AE, ResNet-101, and DNN on the test sets. The results show that in binary classification tasks, the performance of this model decreased to some extent compared to single anomaly detection, but was still superior. Specifically, on the KDD99 dataset, this model significantly outperformed the other three comparison methods in terms of precision, recall, F1-score, and accuracy. On the CIC-DDOS2019 dataset, the accuracy (ACC), recall (Rec), and F1-score of this model were better than other methods, but the precision was low, indicating the model may have misjudged anomalous samples as normal, leading to higher false positives (FPs). On the CIC-IDS2018 dataset, the model’s performance was far from its performance in single anomaly detection experiments. Although the metrics were higher than those in CNN and MLP models, the accuracy and recall were lower than those in the LSTM model. The classification results are shown in Table 13, Table 14 and Table 15.
As indicated in Table 16, we conducted an analysis and summary of the performance metrics for various models on the SR-BH 2020 dataset. These models include the Two-phase MultiOutput CatBoost, Customized model CatBoost, Two-phase MultiOutput LightGBM, Single-phase Clas.Chain LightGBM, Single-phase Clas.Chain CatBoost, Customized model LightGBM, Single-phase Binary Relevance CatBoost, Two-phase Binary Relevance CatBoost, Single-phase Binary Relevance LightGBM, Two-phase Binary Relevance LightGBM, and our model. Our model demonstrated exceptional performance on the SR-BH 2020 dataset, exhibiting high levels of accuracy, precision, recall, and F1-score. This summary aids in assessing the suitability of these models for specific tasks and serves as a reference for selecting the best model.
This research used precision and recall to calculate the false-negative rate (FNR) and false-positive rate (FPR) of the model on the KDD99, CIC-IDS2018, and CIC-DDOS2019 datasets. Through detailed study, we found that the FNR and FPR of the model were close on the KDD99 and CIC-IDS2018 datasets, while the FPR was significantly higher than the FNR on the CIC-DDOS2019 dataset. However, they remained below 10%, and even below 0.01% on the KDD99 dataset. This series of experimental results shows that the FNR and FPR of the model are still maintained at a relatively low level, as shown in Figure 8.

5. Discussion and Conclusions

Web3.0’s extensive connectivity and data transmission provide potential attack channels for hackers, leading to serious issues such as personal privacy leakage, data breaches, and system crashes. Therefore, ensuring the security and privacy protection of Web3.0 is crucial. Intrusion detection systems enhance the security of Web3.0 by analyzing data sources such as network traffic and system logs to detect these attacks.
This study presents an intrusion detection model based on CycleGAN, which utilizes the CycleGAN network as its foundation and employs deep neural network (DNN) structured generators and discriminators. The interaction between the generators and discriminators endows the generators with powerful data augmentation capabilities, while the discriminators exhibit excellent detection abilities. The robust data augmentation capabilities of these two generator models partially address the scarcity of certain anomalous traffic data available for analysis by IDS, thereby enhancing the system’s ability to document instances of malicious behavior. Simultaneously, the outstanding detection abilities of the two discriminators also partially address issues, such as inadequate feature extraction and inaccurate system classification results, typically encountered in traditional IDSs. The intrusion detection system based on CycleGAN makes significant contributions to handling the complexities of feature-rich, nonlinear traffic data in the Web3.0 environment.
To validate the detection performance of this approach, comprehensive performance evaluations were conducted on four widely used intrusion detection benchmark datasets: KDD99, CIC-IDS2018, CIC-DDoS2019, and SR-BH 2020 datasets. The results clearly demonstrate that the proposed deep learning intrusion detection method is feasible and holds practical application potential.
Future research can be directed towards several key areas. First of all, there is scope to improve model performance by exploring advanced deep learning techniques and algorithms. This exploration aims to improve the accuracy and efficiency of intrusion detection systems. Secondly, it is crucial to extend the applicability of the model to different fields, such as industrial control systems and intelligent transportation systems. This extension expands the scope of the model and increases its usefulness in different industries. Finally, rigorous verification and practical application are essential. Working with IoT device manufacturers to deploy the model in a real IoT environment will validate its effectiveness and reliability in practical settings.
This study highlights the prospects of deep learning technology in the field of network security, encouraging further research and application to continuously enhance the level of network security and protect the digital world.

Author Contributions

Methodology, M.F.; Software, Y.W.; Formal analysis, Z.Y.; Investigation, Z.X.; Data curation, X.L.; Writing—review & editing, H.W.; Supervision, Z.K.; Funding acquisition, L.Y. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by Fundamental Research Funds for the Central Universities, the University of International Relations (3262024T01, 3262024T25, 3262024T29), and the Teaching Reform and Innovation Project, University of International Relations (2023030, 2023029).

Data Availability Statement

Previously published articles were used to support this study and these prior studies, and datasets are cited at the relevant places within this article. The link to the datasets and the code for this paper are publicly available at the code address: https://github.com/poshangcun13/CycleGAN-based-intrusion-detection.git.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Dimitris, M.; Nikos, P.; John, A.; Baicun, W.; Lihui, W. Human centric platforms for personalized value creation in metaverse. J. Manuf. Syst. 2022, 65, 653–659. [Google Scholar]
  2. Sean, Y.; Max, L. Web3.0 Data Infrastructure: Challenges and Opportunities. IEEE Netw. 2023, 37, 4–5. [Google Scholar]
  3. Tidjon, L.N.; Frappier, M.; Mammar, A. Intrusion detection systems: A cross-domain overview. IEEE Commun. Surv. Tutor. 2019, 21, 3639–3681. [Google Scholar] [CrossRef]
  4. De Filippi, P.; Mannan, M.; Reijers, W. The alegality of blockchain technology. Policy Soc. 2022, 41, 358–372. [Google Scholar] [CrossRef]
  5. Shi, W.; Pallis, G.; Xu, Z. Edge computing [scanning the issue]. Proc. IEEE 2019, 107, 1474–1481. [Google Scholar] [CrossRef]
  6. Dara, S.; Zargar, S.T.; Muralidhara, V. Towards privacy preserving threat intelligence. J. Inf. Secur. Appl. 2018, 38, 28–39. [Google Scholar] [CrossRef]
  7. Cirillo, S.; Desiato, D.; Scalera, M.; Solimando, G. A Visual Privacy Tool to Help Users in Preserving Social Network Data. In Proceedings of the IS-EUD 2023: 9th International Symposium on End-User Development, Cagliari, Italy, 6–8 June 2023. [Google Scholar]
  8. Michelena, Á.; Aveleira-Mata, J.; Jove, E.; Alaiz-Moretón, H.; Quintián, H.; Calvo-Rolle, J.L. Development of an Intelligent Classifier Model for Denial of Service Attack Detection. Int. J. Interact. Multimed. Artif. Intell. 2023, 8, 33. [Google Scholar] [CrossRef]
  9. Li, K.; Cheng, L.; Teng, C.I. Voluntary sharing and mandatory provision: Private information disclosure on social networking sites. Inf. Process. Manag. 2020, 57, 102128. [Google Scholar] [CrossRef]
  10. Cerruto, F.; Cirillo, S.; Desiato, D.; Gambardella, S.M.; Polese, G. Social network data analysis to highlight privacy threats in sharing data. J. Big Data 2022, 9, 19. [Google Scholar] [CrossRef]
  11. Li, B.; Hu, W.; Qu, X.; Li, Y. A Novel Multi-Attack IDS Framework for Intelligent Connected Terminals Based on Over-the-Air Signature Updates. Electronics 2023, 12, 2267. [Google Scholar] [CrossRef]
  12. Xuan, C.D.; Huong, D.; Nguyen, T. A novel intelligent cognitive computing-based APT malware detection for Endpoint systems. J. Intell. Fuzzy Syst. 2022, 43, 3527–3547. [Google Scholar] [CrossRef]
  13. Zhu, J.Y.; Park, T.; Isola, P.; Efros, A.A. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2223–2232. [Google Scholar]
  14. Available online: http://kdd.ics.uci.edu/databases/kddcup99/kddcup99.html (accessed on 25 March 2024).
  15. Available online: https://www.unb.ca/cic/datasets/ids-2018.html (accessed on 25 March 2024).
  16. Available online: https://www.unb.ca/cic/datasets/ddos-2019.html (accessed on 25 March 2024).
  17. Available online: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/OGOIXX (accessed on 25 March 2024).
  18. Rosenbaltt, F. The Perceptron–A Perciving and Recognizing Automation; Cornell Aeronautical Laboratory: Buffalo, NY, USA, 1957. [Google Scholar]
  19. Minsky, M.; Papert, S. An introduction to computational geometry. Camb. Tiass. HIT 1969, 479, 104. [Google Scholar]
  20. LeCun, Y.; Bottou, L.; Bengio, Y.; Haffner, P. Gradient-based learning applied to document recognition. Proc. IEEE 1998, 86, 2278–2324. [Google Scholar] [CrossRef]
  21. Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet classification with deep convolutional neural networks. Commun. ACM 2017, 60, 84–90. [Google Scholar] [CrossRef]
  22. Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv 2014, arXiv:1409.1556. [Google Scholar]
  23. Szegedy, C.; Liu, W.; Jia, Y.; Sermanet, P.; Reed, S.; Anguelov, D.; Erhan, D.; Vanhoucke, V.; Rabinovich, A. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; pp. 1–9. [Google Scholar]
  24. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
  25. RM, S.P.; Maddikunta, P.K.R.; Parimala, M.; Koppu, S.; Gadekallu, T.R.; Chowdhary, C.L.; Alazab, M. An effective feature engineering for DNN using hybrid PCA-GWO for intrusion detection in IoMT architecture. Comput. Commun. 2020, 160, 139–149. [Google Scholar]
  26. Creswell, A.; White, T.; Dumoulin, V.; Arulkumaran, K.; Sengupta, B.; Bharath, A.A. Generative adversarial networks: An overview. IEEE Signal Process. Mag. 2018, 35, 53–65. [Google Scholar] [CrossRef]
  27. Isola, P.; Zhu, J.Y.; Zhou, T.; Efros, A.A. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 1125–1134. [Google Scholar]
  28. Kim, T.; Cha, M.; Kim, H.; Lee, J.K.; Kim, J. Learning to discover cross-domain relations with generative adversarial networks. In Proceedings of the International Conference on Machine Learning, PMLR, Sydney, Australia, 6–11 August 2017; pp. 1857–1865. [Google Scholar]
  29. Hinton, G.E.; Salakhutdinov, R.R. Reducing the dimensionality of data with neural networks. Science 2006, 313, 504–507. [Google Scholar] [CrossRef]
  30. Kipf, T.N.; Welling, M. Semi-supervised classification with graph convolutional networks. arXiv 2016, arXiv:1609.02907. [Google Scholar]
  31. Anderson, J.P. Computer Security Threat Monitoring and Surveillance; Technical Report; James P. Anderson Company: Kent, OH, USA, 1980. [Google Scholar]
  32. Denning, D.E. An intrusion-detection model. IEEE Trans. Softw. Eng. 1987, SE-13, 222–232. [Google Scholar] [CrossRef]
  33. Rumelhart, D.E.; Hinton, G.E.; Williams, R.J. Learning representations by back-propagating errors. Nature 1986, 323, 533–536. [Google Scholar] [CrossRef]
  34. Muhammad, G.; Hossain, M.S.; Garg, S. Stacked autoencoder-based intrusion detection system to combat financial fraudulent. IEEE Internet Things J. 2020, 10, 2071–2078. [Google Scholar] [CrossRef]
  35. Yang, Y.; Zheng, K.; Wu, B.; Yang, Y.; Wang, X. Network intrusion detection based on supervised adversarial variational auto-encoder with regularization. IEEE Access 2020, 8, 42169–42184. [Google Scholar] [CrossRef]
  36. Khare, N.; Devan, P.; Chowdhary, C.L.; Bhattacharya, S.; Singh, G.; Singh, S.; Yoon, B. Smo-dnn: Spider monkey optimization and deep neural network hybrid classifier model for intrusion detection. Electronics 2020, 9, 692. [Google Scholar] [CrossRef]
  37. Tang, C.; Luktarhan, N.; Zhao, Y. SAAE-DNN: Deep learning method on intrusion detection. Symmetry 2020, 12, 1695. [Google Scholar] [CrossRef]
  38. Al-Fawa’reh, M.; Al-Fayoumi, M.; Nashwan, S.; Fraihat, S. Cyber threat intelligence using PCA-DNN model to detect abnormal network behavior. Egypt. Inform. J. 2022, 23, 173–185. [Google Scholar] [CrossRef]
  39. Thakkar, A.; Lohiya, R. Analyzing fusion of regularization techniques in the deep learning-based intrusion detection system. Int. J. Intell. Syst. 2021, 36, 7340–7388. [Google Scholar] [CrossRef]
  40. Rao, K.N.; Rao, K.V.; Pvgd, P.R. A hybrid intrusion detection system based on sparse autoencoder and deep neural network. Comput. Commun. 2021, 180, 77–88. [Google Scholar]
  41. Balamurugan, E.; Mehbodniya, A.; Kariri, E.; Yadav, K.; Kumar, A.; Haq, M.A. Network optimization using defender system in cloud computing security based intrusion detection system withgame theory deep neural network (IDSGT-DNN). Pattern Recognit. Lett. 2022, 156, 142–151. [Google Scholar] [CrossRef]
  42. Thakkar, A.; Lohiya, R. Fusion of statistical importance for feature selection in Deep Neural Network-based Intrusion Detection System. Inf. Fusion 2023, 90, 353–363. [Google Scholar] [CrossRef]
  43. Thakkar, A.; Lohiya, R. Attack classification of imbalanced intrusion data for IoT network using ensemble learning-based deep neural network. IEEE Internet Things J. 2023, 10, 11888–11895. [Google Scholar] [CrossRef]
  44. Dunmore, A.; Jang-Jaccard, J.; Sabrina, F.; Kwak, J. A Comprehensive Survey of Generative Adversarial Networks (GANs) in Cybersecurity Intrusion Detection. IEEE Access 2023, 11, 76071–76094. [Google Scholar] [CrossRef]
  45. Kumar, V.; Sinha, D. Synthetic attack data generation model applying generative adversarial network for intrusion detection. Comput. Secur. 2023, 125, 103054. [Google Scholar] [CrossRef]
  46. Zhang, Y.; Liu, Q. On IoT intrusion detection based on data augmentation for enhancing learning on unbalanced samples. Future Gener. Comput. Syst. 2022, 133, 213–227. [Google Scholar] [CrossRef]
  47. Bingu, R.; Jothilakshmi, S.; Srinivasu, N. An intelligent multiclass deep classifier-based intrusion detection system for cloud environment. Concurr. Comput. Pract. Exp. 2023, 35, e7840. [Google Scholar] [CrossRef]
  48. Zhou, F.; Du, X.; Li, W.; Lu, Z.; Wu, J. NIDD: An intelligent network intrusion detection model for nursing homes. J. Cloud Comput. 2022, 11, 91. [Google Scholar] [CrossRef]
  49. Staudemeyer, R.C. Applying long short-term memory recurrent neural networks to intrusion detection. S. Afr. Comput. J. 2015, 56, 136–154. [Google Scholar] [CrossRef]
  50. Sayed, M.I.; Sayem, I.M.; Saha, S.; Haque, A. A Multi-Classifier for DDoS Attacks Using Stacking Ensemble Deep Neural Network. In Proceedings of the 2022 International Wireless Communications and Mobile Computing (IWCMC), Dubrovnik, Croatia, 30 May–3 June 2022; pp. 1125–1130. [Google Scholar]
  51. Riera, T.S.; Higuera, J.R.B.; Higuera, J.B.; Herraiz, J.J.M.; Montalvo, J.A.S. A new multi-label dataset for Web attacks CAPEC classification using machine learning techniques. Comput. Secur. 2022, 120, 102788. [Google Scholar] [CrossRef]
Figure 1. The architecture of Web intrusion detection methods.
Figure 1. The architecture of Web intrusion detection methods.
Electronics 13 01711 g001
Figure 2. Model training process diagram.
Figure 2. Model training process diagram.
Electronics 13 01711 g002
Figure 3. Data augmentation.
Figure 3. Data augmentation.
Electronics 13 01711 g003
Figure 4. Classification detection.
Figure 4. Classification detection.
Electronics 13 01711 g004
Figure 5. KDD99 dataset attack distribution.
Figure 5. KDD99 dataset attack distribution.
Electronics 13 01711 g005
Figure 6. CIC-DDOS2019 dataset attack distribution.
Figure 6. CIC-DDOS2019 dataset attack distribution.
Electronics 13 01711 g006
Figure 7. Performance of generator and discriminator batch sizes.
Figure 7. Performance of generator and discriminator batch sizes.
Electronics 13 01711 g007
Figure 8. FNR and FPR of the dataset.
Figure 8. FNR and FPR of the dataset.
Electronics 13 01711 g008
Table 1. Related work.
Table 1. Related work.
IDSDatasetSupervised/ UnsupervisedApplication ScenariosAdvantagesDisadvantagesAlgorithm ComplexityAccuracy
Stacked Autoencoder-Based IDS [36]KDDCup99, NSL-KDD, Aegean Wi-Fi intrusion DatasetSemi-supervisedFinancial TransactionsHas made innovative contributions in the field of financial transactions and achieved high results in this area.It has a high model complexity and therefore requires a lot of time and data to train.High94.2%, 99.7%, 99.9%
SAVAER-DNN [37]NSL-KDD, UNSW-NB15supervisedNetwork MonitoringMore effective in detecting low-frequency and unknown attacks.The data augmentation scheme is unstable. And it requires a large amount of training set data.High89.4%, 93.0%
SMO-DNN [38]KDD Cup 99, NSL-KDDsupervisedNetwork MonitoringCan use less training data and achieve better results.The generalization of the model is low.Middle99.4%, 92.0%
SAAE-DNN [39]NSL-KDDsupervisedSimulation and SimulationLow model complexity.Low accuracy.Low87.7%
PCA-DNN [40]CSE-CI-UNB 2018supervisedNetwork MonitoringLess computational resources required, strong model generalization ability.When subjected to a large number of attacks, its performance will be weakened.Middle97.0%
SAE-DNNL1 [42]UNSW-NB15Semi-supervisedNetwork MonitoringApplying sparsity regularization to weights enables compressed feature extraction for more comprehensive feature capture.Complex transformations of data features can lead to poor generalization ability of the model.High99.9%
IDSGT-DNN [43]CICIDS-2017supervisedCloud ComputingCollecting models and policies can effectively reduce training resources.The applicability of the strategy needs to be considered.Middle97.9%
DNN- feature selection technique [44]NSL-KDD, UNSW _NB-15, CIC-IDS-2017supervisedNetwork MonitoringA simplified feature subset composed of features with high distinguishability and bias can be derived.None.Middle99.84%, 89.03%, 99.80%
OursKDDCup99, CIC-DDOS2019, CIC-IDS2018, SR-BH 2020Semi-supervisedNetwork MonitoringThe required amount of training data is small, the training time is short, and the training resources are limited.Weak generalization ability and lack of interpretability.Low99.81%, 97.79%, 89.25%, 95.15%
Table 2. CIC-IDS2018 Dataset Attack Distribution.
Table 2. CIC-IDS2018 Dataset Attack Distribution.
File Name (Record Date)Attack Type
Thursday—1 March 2018Benign, Infiltration
Friday—2 March 2018Benign, Bot
Wednesday—14 February 2018Benign, SSH-Bruteforce, FTP-BruteForce
Thursday—15 February 2018Benign, DoS-GoldenEye, DoS-Slowloris
Friday—16 February 2018Benign, DoS attack-hulk, DoS attacks-SlowHTTPTest
Tuesday—20 February 2018Benign, DDoS attacks-LOIC-HTTP, DDoS-LOIC-UDP
Wednesday—21 February 2018Benign, DDOS-LOIC-UDP, DDOS-HOIC
Thursday—22 February 2018Benign, Brute Force-Web, Brute Force-XSS, SQL Injection
Friday—23 February 2018Benign, Brute Force-Web, burte Force-XSS, SQL Injection
Wednesday—28 February 2018Benign, Infiltration
Table 3. Number of Web requests by CAPEC classification.
Table 3. Number of Web requests by CAPEC classification.
CAPEC ClassificationNumber of Web Requests% of Total Requests
000-Noraml525,19557.85%
272-Protocol Manipulation91531.00%
242-Code Injection15,8271.74%
88-OS Command Injection74820.82%
126-Path Traversal20,9922.31%
66-SQL Injection250,31127.57%
16-Dictionary-based Password Attack18470.20%
310-Scanning for Vulnerable Software27180.30%
153-Input Data Manipulation22720.25%
274-HTTP Verb Tampering54370.60%
194-Fake the source of data56,1456.18%
34-HTTP Response Splitting19,7382.17%
33-HTTP Request Smuggling10590.12%
TOTAL918,176
Table 4. KDD99 dataset division.
Table 4. KDD99 dataset division.
DatasetLabelTraining SetValidation SetTest Set
KDD99back1900302302
neptune3000500500
guess_passwd3000500500
pod2303030
teardrop9008080
Portsweep900140140
ipsweep1000246246
satan1300285285
nmap2052525
warezclient800210210
buffer_overflow2455
smurf3000500500
Normal16,25928232823
Table 5. CIC-DDOS2019 dataset division.
Table 5. CIC-DDOS2019 dataset division.
DatasetLabelTraining SetValidation SetTest Set
CIC-DDOS2019LDAP3500500500
UDP3500500500
MSSQL4000500500
NetBIOS4000500500
Portmap4000500500
UDPLag1100250250
SYN4000500500
Normal24,10032503250
Table 6. CIC-IDS2018 dataset division.
Table 6. CIC-IDS2018 dataset division.
DatasetLabelTraining SetValidation SetTest Set
CIC-IDS2018Bot3500800800
SSH-Bruteforce3500800800
FTP-Bruteforce3500800800
Dos attacks-Hulk3500800800
DoS attacks-SlowHTTPTest3500800800
Benign17,50040004000
Table 7. SR-BH 2020 dataset division.
Table 7. SR-BH 2020 dataset division.
DatasetLabelTraining SetTest Set
SR-BH 2020272-Protocol Manipulation4000500
242-Code Injection4000500
88-OS Command Injection4000500
126-Path Traversal4000500
66-SQL Injection4000500
16-Dictionary-based Password Attack1300500
310-Scanning for Vulnerable Software2200500
153-Input Data Manipulation1700500
274-HTTP Verb Tampering4000500
194-Fake the Source of Data4000500
34-HTTP Response Splitting4000500
33-HTTP Request Smuggling550500
Table 8. Model parameters.
Table 8. Model parameters.
ParameterGeneratorDiscriminator
Batch Size64 or 3264 or 32
Layers34
Dropout0.50.5
Learn Rate0.000010.00001
Epoch5050
Table 9. Single anomaly detection results for KDD99 dataset.
Table 9. Single anomaly detection results for KDD99 dataset.
DatasetLabelAccuracyPrecisionRecallF1-Score
KDD99back1.01.01.01.0
neptune1.01.01.01.0
guess_passwd1.01.01.01.0
pod1.01.01.01.0
teardrop1.01.01.01.0
Portsweep0.98561.00.97120.9854
ipsweep0.99791.00.99590.9969
satan0.99651.00.99290.9964
nmap0.98231.00.96110.9796
warezclient1.01.01.01.0
buffer_overflow1.01.01.01.0
smurf1.01.01.01.0
Table 10. CIC-DDOS single classification detection results.
Table 10. CIC-DDOS single classification detection results.
DatasetLabelAccuracyPrecisionRecallF1-Score
CIC-DDOS2019LDAP0.99811.00.99620.9979
UDP0.99600.99790.99400.9959
MSSQL0.98900.98220.99600.9890
NetBIOS0.98890.98030.99800.9891
Portmap0.99801.00.99600.9979
UDPLag0.96700.94990.98600.9676
SYN0.94501.00.89000.9418
Table 11. CIC-IDS2018 single classification detection results.
Table 11. CIC-IDS2018 single classification detection results.
DatasetLabelAccuracyPrecisionRecallF1-Score
CIC-IDS2018Bot0.99560.99130.99620.9955
SSH-Bruteforce0.97131.00.94250.9704
FTP-Bruteforce0.93341.00.93340.9657
Dos attacks-Hulk1.01.01.01.0
DoS attacks-SlowHTTPTest1.01.01.01.0
Table 12. SR-BH 2020 dataset single-label CAPEC classification.
Table 12. SR-BH 2020 dataset single-label CAPEC classification.
DatasetLabelAccuracyPrecisionRecallF1-Score
SR-BH 2020272-Protocol Manipulation0.9070.9250.9130.916
242-Code Injection0.8980.9010.8960.889
88-OS Command Injection0.9621.00.9240.960
126-Path Traversal0.9981.00.9960.998
66-SQL Injection0.9930.9900.9960.993
16-Dictionary-based Password Attack0.9730.9491.00.974
310-Scanning for Vulnerable Software0.9990.9981.00.999
153-Input Data Manipulation0.9991.00.9980.999
274-HTTP Verb Tampering0.9930.9950.9900.993
194-Fake the Source of Data0.9800.9621.00.981
34-HTTP Response Splitting0.9871.00.9740.987
33-HTTP Request Smuggling1.01.01.01.0
Table 13. KDD99 dataset II classification.
Table 13. KDD99 dataset II classification.
AlgorithmAccuracyPrecisionRecallF1-Score
LSTM [49]0.96510.97230.97420.9768
CNN0.96550.98720.97640.9633
MLP0.95440.96820.96710.9534
Our Approach0.99810.99691.00.9953
Table 14. CIC-DDOS2019 dataset II classification.
Table 14. CIC-DDOS2019 dataset II classification.
AlgorithmAccuracyPrecisionRecallF1-Score
LSTM [50]0.88500.88100.87800.8700
RNN0.96420.91330.93400.9586
MLP0.92500.84400.94200.8900
Our Approach0.97790.93820.97800.9418
Table 15. Classification of CIC-ISD2018 dataset II.
Table 15. Classification of CIC-ISD2018 dataset II.
AlgorithmAccuracyPrecisionRecallF1-Score
LSTM [47]0.92650.78620.89710.8381
CNN0.82970.62600.48520.5471
MLP0.88670.87460.89120.8827
Our Approach0.89250.89150.89380.8926
Table 16. Metrics in the SR-BH 2020 dataset.
Table 16. Metrics in the SR-BH 2020 dataset.
MethodAccuracyPrecisionRecallF1-Score
Two-phase MultiOutput CatBoost [51]0.884450.895570.888290.88912
Customized model CatBoost0.884360.888630.887900.88501
Two-phase MultiOutput LightGBM0.880950.891370.886410.88615
Single-phase Clas.Chain LightGBM0.872240.876100.873600.87227
Single-phase Clas.Chain CatBoost0.872130.878760.873430.87171
Customized model LightGBM0.858880.861080.862700.85874
Single-phase Binary Relevance CatBoost0.849390.902790.857340.87221
Two-phase Binary Relevance CatBoost0.852010.905150.855080.87680
Single-phase Binary Relevance LightGBM0.844190.899270.851120.87204
Two-phase Binary Relevance LightGBM0.847820.900750.850490.87216
Ours0.951500.916890.993000.95343
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Fang, M.; Wang, Y.; Yang, L.; Wu, H.; Yin, Z.; Liu, X.; Xie, Z.; Kong, Z. Reinventing Web Security: An Enhanced Cycle-Consistent Generative Adversarial Network Approach to Intrusion Detection. Electronics 2024, 13, 1711. https://doi.org/10.3390/electronics13091711

AMA Style

Fang M, Wang Y, Yang L, Wu H, Yin Z, Liu X, Xie Z, Kong Z. Reinventing Web Security: An Enhanced Cycle-Consistent Generative Adversarial Network Approach to Intrusion Detection. Electronics. 2024; 13(9):1711. https://doi.org/10.3390/electronics13091711

Chicago/Turabian Style

Fang, Menghao, Yixiang Wang, Liangbin Yang, Haorui Wu, Zilin Yin, Xiang Liu, Zexian Xie, and Zixiao Kong. 2024. "Reinventing Web Security: An Enhanced Cycle-Consistent Generative Adversarial Network Approach to Intrusion Detection" Electronics 13, no. 9: 1711. https://doi.org/10.3390/electronics13091711

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop