Figure 1.
Generative adversarial network.
Figure 1.
Generative adversarial network.
Figure 2.
Screen capture of the Google Colab interface.
Figure 2.
Screen capture of the Google Colab interface.
Figure 3.
Proposed flow for the machine-learning IDS.
Figure 3.
Proposed flow for the machine-learning IDS.
Figure 4.
Mounting the drive to access the dataset.
Figure 4.
Mounting the drive to access the dataset.
Figure 5.
Heat map of the correlated features.
Figure 5.
Heat map of the correlated features.
Figure 6.
Dataset split in two to train the IDS and GAN models.
Figure 6.
Dataset split in two to train the IDS and GAN models.
Figure 7.
Training dataset normalization using MinMax.
Figure 7.
Training dataset normalization using MinMax.
Figure 8.
Record from the testing dataset for the DoS attack.
Figure 8.
Record from the testing dataset for the DoS attack.
Figure 9.
Source code for the IDS with the K-nearest neighbors algorithm.
Figure 9.
Source code for the IDS with the K-nearest neighbors algorithm.
Figure 10.
Source code for the IDS with the decision tree algorithm.
Figure 10.
Source code for the IDS with the decision tree algorithm.
Figure 11.
Source code for the IDS with the random forest algorithm.
Figure 11.
Source code for the IDS with the random forest algorithm.
Figure 12.
Source code for the IDS with the SVM algorithm.
Figure 12.
Source code for the IDS with the SVM algorithm.
Figure 13.
createModel method for the ANN IDS.
Figure 13.
createModel method for the ANN IDS.
Figure 14.
Source code for the training of the ANN IDS.
Figure 14.
Source code for the training of the ANN IDS.
Figure 15.
Contents of the configuration file.
Figure 15.
Contents of the configuration file.
Figure 16.
Loading of the dataset used for the GAN.
Figure 16.
Loading of the dataset used for the GAN.
Figure 17.
Loading of the models used for the GAN.
Figure 17.
Loading of the models used for the GAN.
Figure 18.
Loading the parameters from the configuration file.
Figure 18.
Loading the parameters from the configuration file.
Figure 19.
Training of the GAN according to the configuration file.
Figure 19.
Training of the GAN according to the configuration file.
Figure 20.
createIDSGANDOSComponents() method example for the DoS attack type.
Figure 20.
createIDSGANDOSComponents() method example for the DoS attack type.
Figure 21.
build_generator() method.
Figure 21.
build_generator() method.
Figure 22.
Summary of the generator model.
Figure 22.
Summary of the generator model.
Figure 23.
The discriminator model method.
Figure 23.
The discriminator model method.
Figure 24.
The intermediary training method.
Figure 24.
The intermediary training method.
Figure 25.
getBatch() method.
Figure 25.
getBatch() method.
Figure 26.
adjustBinaryFeatures() method.
Figure 26.
adjustBinaryFeatures() method.
Figure 27.
adjustContinuousFeatures() method.
Figure 27.
adjustContinuousFeatures() method.
Figure 28.
adjustDiscreteFeatures() method.
Figure 28.
adjustDiscreteFeatures() method.
Figure 29.
retainFunctionalFeatures() method.
Figure 29.
retainFunctionalFeatures() method.
Figure 30.
getAdversarialSample() method.
Figure 30.
getAdversarialSample() method.
Figure 31.
GAN training algorithm.
Figure 31.
GAN training algorithm.
Figure 32.
Loading of the IDS to be tested and tuned by the GAN.
Figure 32.
Loading of the IDS to be tested and tuned by the GAN.
Figure 33.
Loading of the testing dataset.
Figure 33.
Loading of the testing dataset.
Figure 34.
IDS prediction of adversarial entries.
Figure 34.
IDS prediction of adversarial entries.
Figure 35.
Computing the results of the adversarial attack classification.
Figure 35.
Computing the results of the adversarial attack classification.
Figure 36.
DR and EIR computation.
Figure 36.
DR and EIR computation.
Figure 37.
Plotting of generative model results.
Figure 37.
Plotting of generative model results.
Figure 38.
Performance of the IDS models.
Figure 38.
Performance of the IDS models.
Figure 39.
Comparison between probe original and adversarial detection rates using different IDS models.
Figure 39.
Comparison between probe original and adversarial detection rates using different IDS models.
Figure 40.
Comparison of DoS original and adversarial detection rates using different IDS models.
Figure 40.
Comparison of DoS original and adversarial detection rates using different IDS models.
Table 1.
Performance analysis of the kNN IDS.
Table 1.
Performance analysis of the kNN IDS.
Predicted Attack Category | Precision | Recall | F1 Score |
---|
Normal | 0.92 | 0.98 | 0.95 |
DoS | 0.95 | 0.93 | 0.94 |
Probe | 0.92 | 0.67 | 0.77 |
R2L | 0.52 | 0.41 | 0.46 |
U2R | 0 | 0 | 0 |
Table 2.
Confusion matrix for the kNN IDS.
Table 2.
Confusion matrix for the kNN IDS.
Predicted Attack Category | Normal | DoS | Probe | R2L | U2R |
---|
Normal | 97.91% (32,751) | 0.94% (317) | 0.76% (257) | 0.36% (122) | 0 |
DoS | 6.30% (1456) | 93.26% (21,553) | 0.37% (87) | 0.06% (14) | 0 |
Probe | 18.72% (1100) | 13.58% (798) | 66.58% (3912) | 1.10% (65) | 0 |
R2L | 57.57% (304) | 0 | 1.70% (9) | 40.72% (215) | 0 |
U2R | 96.23% (26) | 3.7% (1) | 0 | 0 | 0 |
Table 3.
Performance analysis of the decision tree IDS.
Table 3.
Performance analysis of the decision tree IDS.
Predicted Attack Category | Precision | Recall | F1 Score |
---|
Normal | 0.98 | 0.99 | 0.99 |
DoS | 1.00 | 0.99 | 1.00 |
Probe | 0.96 | 0.95 | 0.95 |
R2L | 0.94 | 0.78 | 0.85 |
U2R | 1.00 | 0.22 | 0.36 |
Table 4.
Confusion matrix for the decision tree IDS.
Table 4.
Confusion matrix for the decision tree IDS.
Predicted Attack Category | Normal | DoS | Probe | R2L | U2R |
---|
Normal | 99.12% (33,152) | 0.14% (48) | 0.66% (221) | 0.07% (26) | 0 |
DoS | 0.49% (113) | 99.4% (22,972) | 0.1% (25) | 0 | 0 |
Probe | 4.87% (286) | 0.03% (2) | 95.08% (5586) | 0.01% (1) | 0 |
R2L | 22.35% (118) | 0 | 0 | 77.65% (528) | 0 |
U2R | 77.78% (21) | 3.7% (1) | 0 | 0 | 22.22% (6) |
Table 5.
Performance analysis of the random forest IDS.
Table 5.
Performance analysis of the random forest IDS.
Predicted Attack Category | Precision | Recall | F1 Score |
---|
Normal | 1.00 | 1.00 | 1.00 |
DoS | 1.00 | 1.00 | 1.00 |
Probe | 1.00 | 1.00 | 1.00 |
R2L | 1.00 | 0.99 | 0.99 |
U2R | 1.00 | 0.89 | 0.94 |
Table 6.
Confusion matrix for the random forest IDS.
Table 6.
Confusion matrix for the random forest IDS.
Predicted Attack Category | Normal | DoS | Probe | R2L | U2R |
---|
Normal | 99.99% (33,443) | 0.002% (1) | 0.008% (3) | 0 | 0 |
DoS | 0.02% (6) | 99.97% (23,103) | 0.004% (1) | 0 | 0 |
Probe | 0.10% (6) | 0 | 99.89% (5869) | 0 | 0 |
R2L | 1.13% (6) | 0 | 0 | 98.86% (522) | 0 |
U2R | 11.11%(3) | 0 | 0 | 0 | 88.88% (24) |
Table 7.
Performance analysis of the SVM IDS.
Table 7.
Performance analysis of the SVM IDS.
Predicted Attack Category | Precision | Recall | F1 Score |
---|
Normal | 0.86 | 0.99 | 0.92 |
DoS | 0.96 | 0.92 | 0.94 |
Probe | 0.93 | 0.37 | 0.53 |
R2L | 0.00 | 0.00 | 0.00 |
U2R | 0.00 | 0.00 | 0.00 |
Table 8.
Confusion matrix for the SVM IDS.
Table 8.
Confusion matrix for the SVM IDS.
Predicted Attack Category | Normal | DoS | Probe | R2L | U2R |
---|
Normal | 99.29% (33,210) | 0.52% (175) | 0.18% (62) | 0 | 0 |
DoS | 7.75% (1791) | 91.8% (21,220) | 0.43% (99) | 0 | 0 |
Probe | 49.58% (2913) | 13.65% (802) | 36.77% (2160) | 0 | 0 |
R2L | 99.24% (524) | 0 | 0.76% (4) | 0 | 0 |
U2R | 96.3% (26) | 3.7% (1) | 0 | 0 | 0 |
Table 9.
Performance analysis of the ANN IDS.
Table 9.
Performance analysis of the ANN IDS.
Predicted Attack Category | Precision | Recall | F1 Score |
---|
Normal | 0.99 | 0.99 | 0.99 |
DoS | 1.00 | 1.00 | 1.00 |
Probe | 0.98 | 0.96 | 0.97 |
R2L | 0.81 | 0.79 | 0.80 |
U2R | 1.00 | 0.56 | 0.71 |
Table 10.
Confusion matrix for the ANN IDS.
Table 10.
Confusion matrix for the ANN IDS.
Predicted Attack Category | Normal | DoS | Probe | R2L | U2R |
---|
Normal | 99.17% (33,169) | 0.19% (63) | 0.36% (122) | 0.28% (93) | 0 |
DoS | 0.06% (13) | 99.92% (23,093) | 0.01% (3) | 0.004% (1) | 0 |
Probe | 3.52% (207) | 0.1% (6) | 96.36% (5661) | 0.02% (1) | 0 |
R2L | 20.83% (110) | 0 | 0 | 79.17% (418) | 0 |
U2R | 25.92% (7) | 3.7% (1) | 3.7% (1) | 11.11% (3) | 55.56% (27) |
Table 11.
Simulation parameters used with the ANN with generated adversarial probe traffic.
Table 11.
Simulation parameters used with the ANN with generated adversarial probe traffic.
Parameter | Value |
---|
Algorithm | ANN |
Epochs | 32 |
Batch size | 32 |
Retain functional parameters | Yes |
Optimizer | ADAM or SGD |
Table 12.
Probe attack detection with the ANN used for the discriminator.
Table 12.
Probe attack detection with the ANN used for the discriminator.
Predicted Attack Category | Initial IDS Testing | ANN, ADAM | ANN, SGD |
---|
Normal | 265 | 2041 | 1591 |
DoS | 84 | 22 | 258 |
Probe | 1808 | 0 | 280 |
R2L | 0 | 94 | 28 |
U2R | 0 | 0 | 0 |
Table 13.
Performance of the ANN.
Table 13.
Performance of the ANN.
Parameters | Initial IDS Testing | ANN, ADAM | ANN, SGD |
---|
Detection rate (DR) | 0.838 | 0 | 0.1298 |
Evasion increase rate (EIR) | N/A | 1.0 | 0.845 |
Percentage of adversarial entries classified as normal data (%) | N/A | 94.6 | 73.75 |
Table 14.
Probe attack detection with the use of the random forest model for the discriminator.
Table 14.
Probe attack detection with the use of the random forest model for the discriminator.
Predicted Attack Category | Initial IDS Testing | RF, ADAM | RF, SGD |
---|
Normal | 285 | 717 | 1591 |
DoS | 45 | 1 | 258 |
Probe | 1827 | 1430 | 280 |
R2L | 0 | 9 | 28 |
U2R | 0 | 0 | 0 |
Table 15.
Performance of the random forest model.
Table 15.
Performance of the random forest model.
Parameters | Initial IDS Testing | RF, ADAM | RF, SGD |
---|
Detection rate (DR) | 84.6 | 0.66 | 0.56 |
Evasion increase rate (EIR) | N/A | 0.21 | 0.32 |
Percentage of adversarial entries classified as normal data (%) | N/A | 33.2 | 42 |
Table 16.
Probe attack detection with kNN used for the discriminator.
Table 16.
Probe attack detection with kNN used for the discriminator.
Predicted Attack Category | Initial IDS Testing | kNN, ADAM | kNN, SGD |
---|
Normal | 399 | 722 | 1427 |
DoS | 156 | 15 | 10 |
Probe | 1600 | 1402 | 713 |
R2L | 2 | 18 | 7 |
U2R | 0 | 0 | 0 |
Table 17.
Performance of kNN algorithm.
Table 17.
Performance of kNN algorithm.
Parameters | Initial IDS Testing | kNN, ADAM | kNN, SGD |
---|
Detection rate (DR) | 0.74 | 0.64 | 0.33 |
Evasion increase rate (EIR) | N/A | 0.123 | 0.55 |
Percentage of adversarial entries classified as normal data (%) | N/A | 33.5 | 66.2 |
Table 18.
DoS attack detection with the use of the ANN for the discriminator.
Table 18.
DoS attack detection with the use of the ANN for the discriminator.
Predicted Attack Category | Initial IDS Testing | ANN, ADAM | ANN, SGD |
---|
Normal | 500 | 1690 | 8095 |
DoS | 7557 | 884 | 0 |
Probe | 38 | 0 | 0 |
R2L | 0 | 5419 | 0 |
U2R | 0 | 102 | 0 |
Table 19.
Performance with DoS when using the ANN IDS.
Table 19.
Performance with DoS when using the ANN IDS.
Parameters | Initial IDS Testing | ANN, ADAM | ANN, SGD |
---|
Detection rate (DR) | 0.9335 | 0.0 | 0.0 |
Evasion increase rate (EIR) | N/A | 0.99 | 1.0 |
Percentage of adversarial entries classified as normal data (%) | N/A | 99.9 | 100 |
Table 20.
DoS attack detection with the use of the random forest algorithm for the discriminator.
Table 20.
DoS attack detection with the use of the random forest algorithm for the discriminator.
Predicted Attack Category | Initial IDS Testing | RF, ADAM | RF, SGD |
---|
Normal | 558 | 5638 | 3420 |
DoS | 7536 | 591 | 4540 |
Probe | 1 | 1886 | 0 |
R2L | 0 | 0 | 135 |
U2R | 0 | 0 | 0 |
Table 21.
Performance with DoS when using the random forest IDS.
Table 21.
Performance with DoS when using the random forest IDS.
Parameters | Initial IDS Testing | RF, ADAM | RF, SGD |
---|
Detection rate (DR) | 0.921 | 0.07 | 0.56 |
Evasion increase rate (EIR) | N/A | 0.92 | 0.39 |
Percentage of adversarial entries classified as normal data (%) | N/A | 66.9 | 42.2 |
Table 22.
DoS attack detection with the use of kNN for the discriminator.
Table 22.
DoS attack detection with the use of kNN for the discriminator.
Predicted Attack Category | Initial IDS Testing | kNN, ADAM | kNN, SGD |
---|
Normal | 887 | 7726 | 4685 |
DoS | 7177 | 324 | 2765 |
Probe | 30 | 42 | 504 |
R2L | 1 | 3 | 141 |
U2R | 0 | 0 | 0 |
Table 23.
Performance with DoS when using the kNN IDS.
Table 23.
Performance with DoS when using the kNN IDS.
Parameters | Initial IDS Testing | kNN, ADAM | kNN, SGD |
---|
Detection rate (DR) | 0.8865 | 0.04 | 0.34 |
Evasion increase rate (EIR) | N/A | 0.95 | 0.61 |
Percentage of adversarial entries classified as normal data (%) | N/A | 95.4 | 57.9 |
Table 24.
IDS rates for KDD and generated adversarial probe traffic.
Table 24.
IDS rates for KDD and generated adversarial probe traffic.
ML Method Used | DR, KDD Traffic | ADAM DR | ADAM EIR | SGD DR | SGD EIR |
---|
ANN | 0.838 | 0.0 | 1.0 | 0.1298 | 0.845 |
Random forest | 0.846 | 0.66 | 0.21 | 0.56 | 0.32 |
kNN | 0.741 | 0.64 | 0.123 | 0.33 | 0.55 |
Table 25.
IDS rates for KDD and generated adversarial DoS traffic.
Table 25.
IDS rates for KDD and generated adversarial DoS traffic.
ML Method Used | DR, KDD Traffic | ADAM DR | ADAM EIR | SGD DR | SGD EIR |
---|
ANN | 0.93 | 0.0 | 0.99 | 0.0 | 1.0 |
Random Forest | 0.92 | 0.07 | 0.92 | 0.56 | 0.39 |
kNN | 0.84 | 0.04 | 0.95 | 0.34 | 0.61 |