| Literature DB >> 35463253 |
Zexuan Ma1, Jin Li1, Yafei Song1, Xuan Wu1, Chen Chen1,2.
Abstract
Imbalanced datasets greatly affect the analysis capability of intrusion detection models, biasing their classification results toward normal behavior and leading to high false-positive and false-negative rates. To alleviate the impact of class imbalance on the detection accuracy of network intrusion detection models and improve their effectiveness, this paper proposes a method based on a feature selection-conditional Wasserstein generative adversarial network (FCWGAN) and bidirectional long short-term memory network (BiLSTM). The method uses the XGBoost algorithm with Spearman's correlation coefficient to select the data features, filters out useless and redundant features, and simplifies the data structure. A conditional WGAN (CWGAN) is used to generate a small number of samples in the dataset, add them to the original training set to supplement the dataset samples, and apply BiLSTM to complete the training of the model and realize the classification. In comparative tests based on the NSL-KDD and UNSW-NB15 datasets, the accuracy of the proposed model reached 99.57% and 85.59%, respectively, which is 1.44% and 2.98% higher than that of the same type of CWGAN and deep neural network (CWGAN-DNN) model, respectively.Entities:
Mesh:
Year: 2022 PMID: 35463253 PMCID: PMC9020925 DOI: 10.1155/2022/6591140
Source DB: PubMed Journal: Comput Intell Neurosci
Figure 1CWGAN workflow diagram.
Figure 2LSTM structure diagram.
Figure 3BiLSTM process diagram.
Figure 4Schematic diagram of model structure based on FCWGAN and BiLSTM.
CWGAN training algorithm.
| Algorithm 1: minority class sample generation based on CWGANs |
|---|
| Input: |
| Output: |
| (1) |
| (2) |
| (3) Sampling {( |
| (4) Sampling {( |
| (5) |
| (6) |
| (7) |
| (8) from |
| (9) |
| (10) |
| (11) |
| (12) |
where θ, η, θ and η respectively denote the network parameters and gradients of the generator and discriminator.
Model parameter settings.
| Parameter | Setting |
|---|---|
| XGBoost maximum depth | 12 |
| XGBoost gamma value | 0 |
| CWGAN learning rate | 0.0001 |
| CWGAN training iterations | 200 |
| Noise dimension | 32 |
| Batch size setting | 1024 |
| Loss function | Categorical cross-entropy |
| Optimizer | Nadam |
| Optimizer learning rate | 0.001 |
| BiLSTM cell count | 64/128 |
| Dropout rate | 0.5 |
Figure 5Distribution of NSL-KDD training set types.
Figure 6Distribution of UNSW-NB15 training set types.
Definition of classification confusion matrix.
| Predicted class | |||
|---|---|---|---|
| Normal | Abnormal | ||
| Actual class | Normal | TP | FN |
| Abnormal | FP | TN | |
Figure 7Feature importance map of NSL-KDD.
Figure 8Feature importance map of UNSW-NB15.
Figure 9Feature correlation diagram of NSL-KDD.
Figure 10Feature correlation diagram of UNSW-NB15.
Feature selection results.
| Dataset | Feature selection | Number |
|---|---|---|
| NSL-KDD | duration, protocol_type, service, dst_host_srv_count, src_bytes, dst_host_count, dst_bytes, count, dst_host_same_src_port_rate, dst_host_srv_diff_host_rate, srv_count, dst_host_rerror_rate, dst_host_serror_rate, diff_srv_rate, srv_diff_host_rate, hot, serror_rate, rerror_rate, num_compromised, num_root | 20 |
|
| ||
| UNSW-NB15 | dur, sload, ct_srv_src, sbytes, stcpd, ct_src_ltm, tcprtt, ct_srv_dst, ct_dst_src_ltm, ct_dst_ltm, djit, sjit, dload, smean, ct_src_dport_ltm, dmean, service, proto, response_body_len | 19 |
Distribution of NSL-KDD dataset before and after sample generation.
| Class | Before sample generation | After sample generation |
|---|---|---|
| Normal | 67343 | 67343 |
| DoS | 45927 | 45927 |
| Probe | 11656 | 11656 |
| R2L | 995 | 5995 |
| U2R | 52 | 5052 |
Distribution of UNSW-NB15 dataset before and after sample generation.
| Class | Before sample generation | After sample generation |
|---|---|---|
| Normal | 56000 | 56000 |
| Generic | 40000 | 40000 |
| Exploits | 33393 | 33393 |
| Fuzzers | 18184 | 18184 |
| DoS | 12264 | 12264 |
| Reconnaissance | 10491 | 10491 |
| Analysis | 2000 | 7000 |
| Backdoor | 1746 | 6746 |
| Shellcode | 1133 | 6133 |
| Worms | 130 | 5130 |
Figure 11NSL-KDD accuracy curve.
Figure 12UNSW-NB15 accuracy curve.
Figure 13NSL-KDD class detection rate curve.
Figure 14UNSW-NB15 class detection rate curve.
Detection accuracy under the influence of different noise levels.
| Dataset | Noise level | ||||
|---|---|---|---|---|---|
| 0 | 0.02 | 0.04 | 0.06 | 0.08 | |
| NSL-KDD | 99.57 ± 0.21 | 99.55 ± 0.22 | 99.45 ± 0.22 | 98.88 ± 0.24 | 98.27 ± 0.25 |
| UNSW-NB15 | 85.59 ± 0.27 | 85.53 ± 0.29 | 85.28 ± 0.30 | 84.71 ± 0.31 | 84.15 ± 0.33 |
Ablation experiment detection rate of various types.
| Algorithm | Type of samples | ||||
|---|---|---|---|---|---|
| Normal | DoS | Probe | U2R | R2L | |
| BiLSTM | 94.65 ± 0.21 | 88.24 ± 0.19 | 72.91 ± 0.23 | 46.81 ± 0.35 | 51.97 ± 0.30 |
| GAN-BiLSTM | 95.31 ± 0.25 | 92.18 ± 0.22 | 81.27 ± 0.30 | 60.33 ± 0.42 | 65.10 ± 0.37 |
| CWGAN-BiLSTM | 98.54 ± 0.19 | 94.60 ± 0.15 | 85.15 ± 0.23 | 70.20 ± 0.26 | 72.13 ± 0.25 |
| Model in this paper | 99.68 ± 0.14 | 96.01 ± 0.11 | 90.12 ± 0.15 | 76.35 ± 0.27 | 80.26 ± 0.19 |
Comparison of data enhancement algorithms on NSL-KDD dataset.
| Algorithm | Evaluation metrics | ||||
|---|---|---|---|---|---|
| Accuracy | Precision | Recall |
| Time (s) | |
| ROS-BiLSTM | 89.18 ± 0.35 | 90.34 ± 0.40 | 88.61 ± 0.35 | 89.46 ± 0.37 | 4 |
| ADASYN-BiLSTM | 92.95 ± 0.24 | 93.12 ± 0.27 | 92.61 ± 0.21 | 92.86 ± 0.25 | 5 |
| SMOTE-BiLSTM | 93.66 ± 0.28 | 94.63 ± 0.34 | 93.14 ± 0.26 | 93.88 ± 0.30 | 3 |
| WGAN-BiLSTM | 96.56 ± 0.23 | 96.71 ± 0.28 | 95.65 ± 0.21 | 96.20 ± 0.26 | 7 |
| Model in this paper | 99.57 ± 0.21 | 99.55 ± 0.20 | 99.47 ± 0.17 | 99.51 ± 0.18 | 2 |
Comparison of data enhancement algorithms on UNSW-NB15 dataset.
| Algorithm | Evaluation metrics | ||||
|---|---|---|---|---|---|
| Accuracy | Precision | Recall |
| Time (s) | |
| ROS-BiLSTM | 81.70 ± 0.43 | 79.32 ± 0.47 | 80.49 ± 0.41 | 79.90 ± 0.44 | 6 |
| ADASYN-BiLSTM | 83.65 ± 0.37 | 84.11 ± 0.40 | 82.14 ± 0.35 | 83.12 ± 0.37 | 6 |
| SMOTE-BiLSTM | 83.66 ± 0.31 | 84.28 ± 0.34 | 81.24 ± 0.27 | 82.73 ± 0.30 | 5 |
| WGAN-BiLSTM | 81.49 ± 0.30 | 84.71 ± 0.24 | 82.51 ± 0.28 | 83.60 ± 0.26 | 8 |
| Model in this paper | 85.59 ± 0.27 | 86.11 ± 0.21 | 85.57 ± 0.24 | 85.84 ± 0.22 | 4 |
Comparison of classification algorithms on NSL-KDD dataset.
| Algorithm | Evaluation metrics | ||||
|---|---|---|---|---|---|
| Accuracy | Precision | Recall |
| Time (s) | |
| FCWGAN-RF | 91.29 ± 0.27 | 90.24 ± 0.29 | 89.11 ± 0.21 | 89.67 ± 0.24 | 1 |
| FCWGAN-DNN | 95.11 ± 0.23 | 96.01 ± 0.22 | 94.98 ± 0.17 | 95.00 ± 0.19 | 2 |
| FCWGAN-LSTM | 98.29 ± 0.23 | 98.37 ± 0.21 | 98.14 ± 0.15 | 98.25 ± 0.18 | 2 |
| Model in this paper | 99.57 ± 0.21 | 99.55 ± 0.20 | 99.47 ± 0.17 | 99.51 ± 0.18 | 2 |
Comparison of classification algorithms on UNSW-NB15 dataset.
| Algorithm | Evaluation metrics | ||||
|---|---|---|---|---|---|
| Accuracy | Precision | Recall |
| Time (s) | |
| FCWGAN-RF | 81.00 ± 0.37 | 81.94 ± 0.33 | 80.97 ± 0.31 | 81.45 ± 0.32 | 1 |
| FCWGAN-DNN | 83.44 ± 0.31 | 84.12 ± 0.33 | 83.40 ± 0.27 | 83.76 ± 0.30 | 2 |
| FCWGAN-LSTM | 84.98 ± 0.30 | 85.44 ± 0.29 | 84.67 ± 0.25 | 85.05 ± 0.28 | 3 |
| Model in this paper | 85.59 ± 0.27 | 86.11 ± 0.21 | 85.57 ± 0.24 | 85.84 ± 0.22 | 4 |
Comparison of multiclassification on NSL-KDD dataset.
| Algorithm | Evaluation metrics | ||||
|---|---|---|---|---|---|
| Accuracy | Precision | Recall |
| Time (s) | |
| CNN-BiLSTM | 99.22 ± 0.31 | 99.18 ± 0.29 | 99.14 ± 0.24 | 99.15 ± 0.26 | 6 |
| SSAE-LSTM | 97.63 ± 0.34 | 97.91 ± 0.33 | 97.21 ± 0.28 | 97.56 ± 0.30 | 4 |
| CWGAN-DNN | 98.13 ± 0.26 | 99.03 ± 0.30 | 97.91 ± 0.25 | 98.46 ± 0.27 | 8 |
| AE-CGAN-RF | 98.53 ± 0.27 | 98.67 ± 0.28 | 98.31 ± 0.23 | 98.49 ± 0.25 | 7 |
| Model in this paper | 99.57 ± 0.21 | 99.55 ± 0.20 | 99.47 ± 0.17 | 99.51 ± 0.18 | 2 |
Comparison of multiclassification on UNSW-NB15 dataset.
| Algorithm | Evaluation metrics | ||||
|---|---|---|---|---|---|
| Accuracy | Precision | Recall |
| Time (s) | |
| CNN-BiLSTM | 82.08 ± 0.43 | 82.68 ± 0.43 | 80.00 ± 0.37 | 81.32 ± 0.40 | 10 |
| SSAE-LSTM | 82.31 ± 0.45 | 83.65 ± 0.44 | 81.94 ± 0.36 | 82.78 ± 0.41 | 7 |
| CWGAN-DNN | 82.61 ± 0.37 | 82.95 ± 0.41 | 82.11 ± 0.33 | 82.53 ± 0.38 | 14 |
| AE-CGAN-RF | 81.24 ± 0.39 | 83.47 ± 0.40 | 80.31 ± 0.35 | 81.86 ± 0.38 | 13 |
| Model in this paper | 85.59 ± 0.27 | 86.11 ± 0.21 | 85.57 ± 0.24 | 85.84 ± 0.22 | 4 |