| Literature DB >> 35634110 |
Miodrag Zivkovic1, Milan Tair1, Venkatachalam K2, Nebojsa Bacanin1, Štěpán Hubálovský2, Pavel Trojovský3.
Abstract
The research proposed in this article presents a novel improved version of the widely adopted firefly algorithm and its application for tuning and optimising XGBoost classifier hyper-parameters for network intrusion detection. One of the greatest issues in the domain of network intrusion detection systems are relatively high false positives and false negatives rates. In the proposed study, by using XGBoost classifier optimised with improved firefly algorithm, this challenge is addressed. Based on the established practice from the modern literature, the proposed improved firefly algorithm was first validated on 28 well-known CEC2013 benchmark instances a comparative analysis with the original firefly algorithm and other state-of-the-art metaheuristics was conducted. Afterwards, the devised method was adopted and tested for XGBoost hyper-parameters optimisation and the tuned classifier was tested on the widely used benchmarking NSL-KDD dataset and more recent USNW-NB15 dataset for network intrusion detection. Obtained experimental results prove that the proposed metaheuristics has significant potential in tackling machine learning hyper-parameters optimisation challenge and that it can be used for improving classification accuracy and average precision of network intrusion detection systems.Entities:
Keywords: Benchmark; Firefly algorithm; Intrusion detection; Machine learning; Optimisation
Year: 2022 PMID: 35634110 PMCID: PMC9137854 DOI: 10.7717/peerj-cs.956
Source DB: PubMed Journal: PeerJ Comput Sci ISSN: 2376-5992
The CFAEE-SCA pseudo-code
| Initialise control parameters |
| Initialise search space parameters |
| Initialise CFAEE-SCA parameters |
| Initialise random population |
| |
| |
| |
| Generate pseudo-random value |
| |
| Perform FA search |
| Move solution |
| Attractiveness changes with distance |
| Evaluate new solution, swap the worse individual for a better one and update light intensity |
|
|
| Perform SCA search |
| Move solution |
|
|
|
|
|
|
|
|
| |
| Swap solutions where |
|
|
| Swap solutions where |
| |
| Perform gBest CLS around the |
| Retain better solution between |
| |
|
|
| Update parameters |
|
|
| Return the best individual |
| Post-process results and perform visualisation |
Figure 1Flowchart of the proposed CFAEE-SCA algorithm.
CEC2013 functions used in the benchmark experiments.
| No | Functions | Initial range |
|---|---|---|
| Uni-modal Functions | ||
| 1 | Sphere function | [−100, 100] |
| 2 | Rotated High Conditioned Elliptic Function | [−100, 100] |
| 3 | Rotated Bent Cigar Function | [−100, 100] |
| 4 | Rotated Discus Function | [−100, 100] |
| 5 | Different Powers Function | [−100, 100] |
| Basic multi-modal Functions | ||
| 6 | Rotated Rosenbrock’s Function | [−100, 100] |
| 7 | Rotated Schaffer’s F7 Function | [−100, 100] |
| 8 | Rotated Ackley’s Function | [−100, 100] |
| 9 | Rotated Weierstrass Function | [−100, 100] |
| 10 | Rotated Griewank’s Function | [−100, 100] |
| 11 | Rastrigin’s Function | [−100, 100] |
| 12 | Rotated Rastrigin’s Function | [−100, 100] |
| 13 | Non-Continuous Rotated Rastrigin’s Function | [−100, 100] |
| 14 | Schwefel’s Function | [−100, 100] |
| 15 | Rotated Schwefel’s Function | [−100, 100] |
| 16 | Rotated Katsuura Function | [−100, 100] |
| 17 | Lunacek Bi_Rastrigin Function | [−100, 100] |
| 18 | Rotated Lunacek Bi_Rastrigin Function | [−100, 100] |
| 19 | Expanded Griewank’s plus Rosenbrock’s Function | [−100, 100] |
| 20 | Expanded Schaffer’s F6 Function | [−100, 100] |
| Composite Functions | ||
| 21 | Composite Function 1 ( | [−100, 100] |
| 22 | Composite Function 2 ( | [−100, 100] |
| 23 | Composite Function 3 ( | [−100, 100] |
| 24 | Composite Function 4 ( | [−100, 100] |
| 25 | Composite Function 5 ( | [−100, 100] |
| 26 | Composite Function 6 ( | [−100, 100] |
| 27 | Composite Function 7 ( | [−100, 100] |
| 28 | Composite Function 8 ( | [−100, 100] |
Results comparison CEC2013 unimodal functions 1–5.
| FA | RGA | GSA | D-GSA | BH-GSA | C-GSA | AR-GSA | CFAEE-SCA | |
|---|---|---|---|---|---|---|---|---|
| F1 | ||||||||
| Best | 0.00E+00 | 1.845E+02 | 0.00E+00 | 6.71E−01 | 4.57E−13 | 2.28E−13 | 0.00E+00 | 0.00E+00 |
| Median | 0.00E+00 | 2.82E+02 | 0.00E+00 | 9.54E−01 | 3.67E−12 | 2.24E−13 | 0.00E+00 | 0.00E+00 |
| Worst | 2.14E−13 | 3.55E+02 | 2.24E−13 | 1.48E+00 | 5.02E−12 | 4.53E−13 | 0.00E+00 | 0.00E+00 |
| Mean | 6.92E−14 | 2.85E+02 | 7.54E−14 | 9.76E−01 | 3.33E−12 | 2.74E−13 | 0.00E+00 | 0.00E+00 |
| Std | 1.13E−13 | 3.12E+01 | 1.09E−13 | 1.95E−01 | 1.02E−12 | 9.48E−14 | 0.00E+00 | 0.00E+00 |
| F2 | ||||||||
| Best | 9.14E+05 | 1.06E+07 | 9.23E+05 | 7.29E+06 | 5.26E+05 | 9.66E+05 | 1.58E+05 |
|
| Median | 1.75E+06 | 1.61E+07 | 1.72E+06 | 1.14E+07 | 1.95E+06 | 1.77E+06 | 6.08E+05 |
|
| Worst | 3.59E+06 | 2.52E+07 | 3.36E+06 | 1.84E+07 | 4.92E+06 |
| 6.55E+06 | 6.51E+06 |
| Mean | 1.26E+06 | 1.72E+07 | 1.84E+06 | 1.18E+07 | 2.03E+06 | 1.85E+06 | 1.39E+06 |
|
| Std | 5.24E+05 | 3.65E+06 | 5.14E+05 | 2.19E+06 | 7.82E+05 |
| 1.70E+06 | 1.48E+06 |
| F3 | ||||||||
| Best | 2.73E+07 | 3.32E+09 | 2.81E+07 | 1.04E+09 | 4.85E−05 | 2.88E+07 | 7.73E−12 |
|
| Median | 7.69E+08 | 6.27E+09 | 7.88E+08 | 2.92E+09 | 1.59E+06 | 1.09E+09 | 1.24E−11 |
|
| Worst | 2.95E+09 | 2.34E+10 | 2.98E+09 | 9.24E+09 | 2.91E+19 | 4.42E+09 | 1.48E−11 |
|
| Mean | 9.85E+08 | 6.74E+09 | 9.86E+08 | 3.53E+09 | 5.72E+17 | 1.23E+09 | 1.18E−11 |
|
| Std | 7.54E+08 | 3.01E+09 | 7.16E+08 | 1.74E+09 | 4.09E+18 | 8.44E+08 | 1.83E−12 |
|
| F4 | ||||||||
| Best | 5.75E+04 | 5.18E+04 | 5.74E+04 | 5.82E+04 | 4.96E+04 | 5.62E+04 | 4.61E+04 |
|
| Median | 6.83E+04 | 7.14E+04 | 6.89E+04 | 6.85E+04 | 6.84E+04 | 6.93E+04 | 6.51E+04 |
|
| Worst | 7.95E+04 | 1.06E+05 | 7.94E+04 |
| 9.05E+04 | 8.59E+04 | 7.81E+04 | 7.55E+04 |
| Mean | 6.84E+04 | 7.32E+04 | 6.82E+04 | 6.75E+04 | 6.82E+04 | 7.04E+04 | 6.48E+04 |
|
| Std | 5.82E+03 | 1.22E+04 | 5.63E+03 |
| 8.19E+03 | 5.22E+03 | 7.83E+03 | 7.48E+03 |
| F5 | ||||||||
| Best | 1.62E−12 | 1.93E+02 |
| 2.70E+00 | 1.94E−11 | 1.42E−11 | 2.04E−08 | 2.28E−08 |
| Median | 2.64E−12 | 3.05E+02 |
| 1.51E+01 | 1.02E−10 | 2.12E−11 | 9.93E−08 | 8.85E−08 |
| Worst | 3.98E−12 | 4.63E+02 |
| 6.04E+01 | 3.33E−10 | 5.74E−11 | 1.85E−07 | 2.89E−07 |
| Mean | 2.65E−12 | 3.04E+02 |
| 1.90E+01 | 1.23E−10 | 2.34E−11 | 1.05E−07 | 1.53E−07 |
| Std | 5.79E−13 | 6.11E+01 |
| 1.12E+01 | 7.13E−11 | 7.50E−12 | 3.54E−08 | 3.49E−08 |
Note:
The best obtained results for each metric are marked in bold.
Results comparison CEC2013 composite functions 21–28.
| FA | RGA | GSA | D-GSA | BH-GSA | C-GSA | AR-GSA | CFAEE−SCA | |
|---|---|---|---|---|---|---|---|---|
| F21 | ||||||||
| Best | 1.33E+02 | 4.61E+02 | 1.00E+02 | 1.28E+02 | 2.01E+02 |
| 2.00E+02 | 1.93E+02 |
| Median | 3.68E+02 | 5.64E+02 | 3.00E+02 | 3.16E+02 | 3.00E+02 | 3.00E+02 | 3.00E+02 |
|
| Worst | 4.79E+02 | 6.05E+02 | 4.44E+02 | 4.44E+02 | 4.44E+02 | 4.44E+02 | 4.44E+02 |
|
| Mean | 3.39E+02 | 5.39E+02 | 3.18E+02 | 3.39E+02 | 3.35E+02 | 3.34E+02 | 3.25E+02 |
|
| Std | 7.45E+01 | 4.31E+01 | 7.27E+01 | 7.16E+01 | 9.11E+01 | 7.99E+01 | 9.24E+01 |
|
| F22 | ||||||||
| Best | 3.99+03 | 4.32E+03 | 3.79E+03 | 4.01E+03 | 3.30E+02 | 3.88E+03 | 3.10E+02 |
|
| Median | 5.49E+03 | 4.98E+03 | 5.20E+03 | 5.41E+03 | 1.09E+03 | 5.54E+03 | 1.12E+03 |
|
| Worst | 7.33E+03 | 5.76E+03 | 7.12E+03 | 7.06E+03 | 2.23E+03 | 7.51E+03 | 2.25E+03 |
|
| Mean | 5.66E+03 | 5.07E+03 | 5.36E+03 | 5.55E+03 | 1.21E+03 | 5.53E+03 | 1.11E+03 |
|
| Std | 8.96E+02 | 3.42E+02 | 8.60E+02 | 7.92E+02 | 4.11E+02 | 8.05E+02 | 3.85E+02 |
|
| F23 | ||||||||
| Best | 4.45E+03 | 4.39E+03 | 4.24E+03 | 4.87E+03 |
| 3.85E+03 | 1.02E+03 | 1.24E+03 |
| Median | 5.73E+03 | 5.42E+03 | 5.51E+03 | 5.57E+03 | 1.97E+03 | 5.50E+03 |
| 1.89E+03 |
| Worst | 6.95E+03 | 6.23E+03 | 6.68E+03 | 6.42E+03 | 4.26E+03 | 6.11E+03 |
| 3.84E+03 |
| Mean | 5.83E+03 | 5.42E+03 | 5.56E+03 | 5.60E+03 | 2.12E+03 | 5.46E+03 |
| 2.12E+03 |
| Std | 4.62E+02 | 4.04E+02 | 4.38E+02 | 3.24E+02 | 7.62E+02 | 4.33E+02 | 6.02E+02 |
|
| F24 | ||||||||
| Best | 2.55E+02 | 2.32E+02 | 2.20E+02 | 2.17E+02 | 2.02E+02 | 2.30E+02 | 2.00E+02 |
|
| Median | 2.75E+02 | 2.38E+02 | 2.59E+02 | 2.60E+02 | 2.01E+02 | 2.57E+02 | 2.00E+02 |
|
| Worst | 3.99E+02 | 2.79E+02 | 3.92E+02 | 3.83E+02 | 2.11E+02 | 3.88E+02 |
| 2.05E+02 |
| Mean | 2.86E+02 | 2.41E+02 | 2.80E+02 | 2.72E+02 | 2.02E+02 | 2.69E+02 | 2.00E+02 | 2.00E+00 |
| Std | 4.65E+01 | 1.13E+01 | 4.50E+01 | 3.77E+01 | 1.19E−01 | 3.64E+01 | 2.46E−02 |
|
| F25 | ||||||||
| Best | 2.30E+02 | 2.41E+02 | 2.00E+02 | 2.10E+02 | 2.00E+02 | 2.00E+02 | 2.00E+02 |
|
| Median | 3.62E+02 | 2.84E+02 | 3.42E+02 | 3.49E+02 | 2.00E+02 | 3.40E+02 | 2.00E+02 |
|
| Worst | 4.23E+02 | 3.05E+02 | 3.88E+02 | 3.87E+02 | 2.72E+02 | 3.84E+02 | 2.00E+02 |
|
| Mean | 3.91E+02 | 2.73E+02 | 3.34E+02 | 3.40E+02 | 2.13E+02 | 3.34E+02 | 2.00E+02 |
|
| Std | 4.62E+01 | 2.52E+01 | 4.08E+01 | 3.70E+01 | 2.54E+01 | 4.18E+01 | 1.84E−05 |
|
| F26 | ||||||||
| Best | 2.62E+02 | 2.21E+02 | 2.35E+02 | 2.00E+02 |
| 2.00E+02 | 2.28E+02 | 2.29E+02 |
| Median | 3.73E+02 | 3.41E+02 | 3.42E+02 | 3.51E+02 | 3.00E+02 | 3.47E+02 |
| 3.02E+02 |
| Worst | 3.98E+02 | 3.65E+02 | 3.77E+02 | 3.71E+02 | 3.26E+02 | 3.73E+02 |
| 3.23E+02 |
| Mean | 3.48E+02 | 3.16E+02 | 3.30E+02 | 3.34E+02 |
| 3.25E+02 | 2.93E+02 | 2.96E+02 |
| Std | 3.94E+01 | 6.05E+01 | 3.76E+01 | 4.37E+01 | 4.29E+01 | 4.78E+01 | 1.72E+01 |
|
| F27 | ||||||||
| Best | 5.75E+02 | 6.18E+02 | 5.85E+02 | 6.12E+02 | 3.01E+02 | 6.26E+02 |
| 3.18E+02 |
| Median | 7.58E+02 | 7.95E+02 | 7.64E+02 | 8.42E+02 | 3.01E+02 | 7.69E+02 |
| 3.22E+02 |
| Worst | 9.89E+02 | 1.03E+03 | 9.88E+02 | 1.04E+03 | 3.05E+02 | 1.02E+03 |
| 3.29E+02 |
| Mean | 7.83E+02 | 7.76E+02 | 7.88E+02 | 8.40E+02 | 3.02E+02 | 7.86E+02 |
| 3.23E+02 |
| Std | 1.06E+02 | 1.35E+02 | 1.10E+02 | 1.12E+02 | 1.15E+00 | 9.31E+01 |
| 4.29E−01 |
| F28 | ||||||||
| Best | 2.42E+03 | 5.10E+02 | 2.47E+03 | 2.84E+03 |
| 2.35E+03 | 3.00E+02 | 3.25E+02 |
| Median | 3.35E+03 | 8.14E+02 | 3.12E+03 | 3.23E+03 | 3.01E+02 | 3.18E+03 | 3.00E+02 | 3.27E+02 |
| Worst | 3.67E+03 | 1.76E+03 | 3.69E+03 | 3.93E+03 | 1.37E+03 | 3.94E+03 |
| 3.33E+02 |
| Mean | 3.10E+03 | 8.93E+02 | 3.16E+03 | 3.24E+03 | 3.52E+02 | 3.25E+03 |
| 3.26E+02 |
| Std | 2.66E+02 | 3.54E+02 | 2.73E+02 | 2.38E+02 | 2.54E+02 | 2.92E+02 |
| 8.95E−09 |
Note:
The best obtained results for each metrics are marked in bold.
Figure 2Converging velocity graphs of the eight CEC 2013 benchmark functions as direct comparison between the proposed CFAEE-SCA method and other relevant algorithms.
Friedman test ranks for the observed methods over 28 CEC2013 functions.
| Functions | FA | RGA | GSA | D-GSA | BH-GSA | C-GSA | AR-GSA | CFAEE-SCA |
|---|---|---|---|---|---|---|---|---|
| F1 | 3 | 8 | 4 | 7 | 6 | 5 | 1.5 | 1.5 |
| F2 | 1 | 8 | 5 | 7 | 6 | 4 | 3 | 2 |
| F3 | 4 | 7 | 3 | 6 | 8 | 5 | 2 | 1 |
| F4 | 6 | 8 | 4.5 | 3 | 4.5 | 7 | 2 | 1 |
| F5 | 1 | 8 | 2 | 7 | 4 | 3 | 5 | 6 |
| F6 | 4 | 8 | 6 | 7 | 1 | 5 | 3 | 2 |
| F7 | 6 | 7 | 5 | 8 | 3 | 4 | 2 | 1 |
| F8 | 2 | 5.5 | 5.5 | 5.5 | 5.5 | 8 | 3 | 1 |
| F9 | 7 | 4 | 5 | 8 | 3 | 6 | 2 | 1 |
| F10 | 5 | 8 | 4 | 7 | 3 | 6 | 2 | 1 |
| F11 | 8 | 4 | 7 | 5.5 | 2 | 5.5 | 3 | 1 |
| F12 | 5 | 4 | 7 | 8 | 1 | 6 | 3 | 2 |
| F13 | 8 | 4 | 7 | 5 | 2 | 6 | 3 | 1 |
| F14 | 4 | 8 | 5 | 6 | 3 | 7 | 2 | 1 |
| F15 | 4 | 8 | 6 | 7 | 3 | 5 | 2 | 1 |
| F16 | 4 | 8 | 3 | 7 | 6 | 5 | 2 | 1 |
| F17 | 5 | 8 | 2 | 7 | 4 | 1 | 6 | 3 |
| F18 | 5 | 8 | 2 | 7 | 4 | 3 | 6 | 1 |
| F19 | 2 | 8 | 1 | 7 | 6 | 3 | 4 | 5 |
| F20 | 8 | 4 | 4 | 4 | 4 | 4 | 4 | 4 |
| F21 | 1 | 8 | 3 | 7 | 6 | 5 | 4 | 2 |
| F22 | 8 | 4 | 5 | 7 | 3 | 6 | 2 | 1 |
| F23 | 8 | 4 | 6 | 7 | 2.5 | 5 | 1 | 2.5 |
| F24 | 8 | 4 | 7 | 6 | 3 | 5 | 2 | 1 |
| F25 | 8 | 4 | 5.5 | 7 | 3 | 5.5 | 2 | 1 |
| F26 | 4 | 5 | 7 | 8 | 1 | 6 | 2 | 3 |
| F27 | 7 | 4 | 5.5 | 8 | 2 | 5.5 | 1 | 3 |
| F28 | 5 | 4 | 6 | 8 | 3 | 7 | 1 | 2 |
| Average Ranking | 5.036 | 6.161 | 4.750 | 6.679 | 3.661 | 5.125 | 2.696 | 1.893 |
| Rank | 5 | 7 | 4 | 8 | 3 | 6 | 2 | 1 |
Aligned Friedman test ranks for the observed methods over 28 CEC2013 functions.
| Functions | FA | RGA | GSA | D-GSA | BH-GSA | C-GSA | AR-GSA | CFAEE-SCA |
|---|---|---|---|---|---|---|---|---|
| F1 | 64 | 192 | 65 | 68 | 67 | 66 | 62.5 | 62.5 |
| F2 | 8 | 223 | 12 | 222 | 13 | 11 | 10 | 9 |
| F3 | 4 | 7 | 3 | 6 | 224 | 5 | 1.5 | 1.5 |
| F4 | 216 | 221 | 195.5 | 32 | 195.5 | 219 | 15 | 14 |
| F5 | 51 | 194 | 52 | 85 | 54 | 53 | 55 | 56 |
| F6 | 109 | 167 | 115 | 153 | 73 | 112 | 87 | 84 |
| F7 | 148 | 155 | 147 | 157 | 79 | 146 | 71 | 70 |
| F8 | 123 | 132.5 | 132.5 | 132.5 | 132.5 | 136 | 130 | 113 |
| F9 | 144 | 139 | 142 | 145 | 95 | 143 | 93 | 92 |
| F10 | 103 | 164 | 102 | 105 | 101 | 104 | 100 | 99 |
| F11 | 175 | 156 | 170 | 168.5 | 44 | 168.5 | 45 | 43 |
| F12 | 171 | 159 | 173 | 174 | 40 | 172 | 42 | 41 |
| F13 | 190 | 50 | 182 | 179 | 38 | 180 | 39 | 37 |
| F14 | 187 | 218 | 197 | 199 | 30 | 201 | 29 | 27 |
| F15 | 193 | 220 | 200 | 202 | 24 | 198 | 23 | 22 |
| F16 | 127 | 138 | 126 | 137 | 129 | 128 | 125 | 124 |
| F17 | 82 | 183 | 75 | 158 | 77 | 74 | 83 | 76 |
| F18 | 69 | 181 | 59 | 177 | 61 | 60 | 78 | 57 |
| F19 | 107 | 150 | 106 | 135 | 114 | 108 | 110 | 111 |
| F20 | 140 | 119 | 119 | 119 | 119 | 119 | 119 | 119 |
| F21 | 49 | 189 | 72 | 97 | 91 | 89 | 81 | 58 |
| F22 | 217 | 206 | 212 | 214 | 18 | 213 | 17 | 16 |
| F23 | 215 | 203 | 207 | 208 | 20.5 | 204 | 19 | 20.5 |
| F24 | 176 | 152 | 166 | 163 | 88 | 162 | 86 | 36 |
| F25 | 178 | 94 | 160.5 | 165 | 48 | 160.5 | 47 | 46 |
| F26 | 98 | 141 | 151 | 154 | 80 | 149 | 90 | |
| F27 | 188 | 184 | 185.5 | 191 | 34 | 185.5 | 33 | 35 |
| F28 | 205 | 31 | 209 | 211 | 28 | 210 | 25 | 26 |
| Average Ranking | 133.464 | 156.018 | 133.429 | 148.464 | 75.625 | 134.875 | 61.286 | 56.839 |
| Rank | 5 | 8 | 4 | 7 | 3 | 6 | 2 | 1 |
Friedman and Iman-Davenport statistical test results summary (α = 0.05).
| Friedman value | Iman-Davenport value | |||
|---|---|---|---|---|
| 8.866E+01 | 1.407E+01 | 1.110E−16 | 2.230E+01 | 2.058E+00 |
Results of the Holm’s step-down procedure.
| Comparison | Ranking | alpha = 0.05 | alpha = 0.1 | H1 | H2 | |
|---|---|---|---|---|---|---|
| CFAEE-SCA | 1.33227E−13 | 0 | 0.007142857 | 0.014285714 | TRUE | TRUE |
| CFAEE-SCA | 3.53276E−11 | 1 | 0.008333333 | 0.016666667 | TRUE | TRUE |
| CFAEE-SCA | 3.96302E−07 | 2 | 0.01 | 0.02 | TRUE | TRUE |
| CFAEE-SCA | 7.90191E−07 | 3 | 0.0125 | 0.025 | TRUE | TRUE |
| CFAEE-SCA | 6.37484E−06 | 4 | 0.016666667 | 0.033333333 | TRUE | TRUE |
| CFAEE-SCA | 0.003462325 | 5 | 0.025 | 0.05 | TRUE | TRUE |
| CFAEE-SCA | 0.109821937 | 6 | 0.05 | 0.1 | FALSE | FALSE |
XGBoost parameters optimised by CFAEE-SCA.
| Parameter | Default | Range | Details |
|---|---|---|---|
| eta | 0.3 | [0, 1] | Learning rate |
| max_depth | 6 | [0, + | Maximum depth of the tree |
| min_child_weight | 1 | [0, + | Minimum leaf weight |
| gamma | 0 | [0, + | Related to loss function |
| sub-sample | 1 | (0, 1] | Controls sampling to prevent over-fitting |
| colsample_bytree | 1 | (0, 1] | Controls feature sampling proportions |
Figure 3Pipeline of CFAEE-SCA-XGBoost framework.
NSL-KDD dataset summary.
| Property | Description |
|---|---|
| Number of records | 126,620 |
| Number of features | 41 |
| Number of classes | 2 (normal uses and attacks) |
| Groups of attacks | 4 (Probe, DoS, U2R and R2L) |
| Types of attacks | 38 in total (21 in training set) |
| Number of sets | 2 (a training and a testing set) |
NSL-KDD dataset structure.
| Event type | Training set | Testing set | ||
|---|---|---|---|---|
| Normal use | 67,343 | 53.46% | 9,711 | 43.08% |
| DoS | 45,927 | 36.46% | 7,456 | 33.07% |
| Probe | 11,656 | 9.25% | 2,421 | 10.74% |
| U2R | 52 | 0.04% | 200 | 0.89% |
| R2L | 995 | 0.79% | 2,756 | 12.22% |
| Total | 125,973 | 22,544 |
Figure 4Visual representation of training and testing NSL-KDD datasets.
The dataset testing set optimal parameters confusion matrix.
| Normal | Probe | Dos | U2R | R2L | Average/total | ||
|---|---|---|---|---|---|---|---|
| XGBoost | Precision | 0.63 | 0.75 |
| 0.75 | 0.67 | 0.76 |
| Recall | 0.97 | 0.71 | 0.67 | 0.03 | 0.00 | 0.72 | |
| F-Score | 0.76 | 0.73 | 0.79 | 0.06 | 0.00 | 0.67 | |
| Support | 9,711 | 2,421 | 7,458 | 200 | 2,754 | 22,544 | |
| PSO-XGBoost | Precision | 0.66 |
| 0.94 |
|
| 0.81 |
| Recall | 0.96 | 0.52 | 0.84 | 0.01 | 0.05 | 0.74 | |
| F-Score | 0.76 | 0.64 | 0.87 | 0.01 | 0.09 | 0.70 | |
| Support | 9,771 | 2,421 | 7,458 | 200 | 2,754 | 22,544 | |
| FA-XGBoost | Precision | 0.67 | 0.79 | 0.93 | 0.92 | 0.85 | 0.79 |
| Recall | 0.97 | 0.63 | 0.87 | 0.15 | 0.62 | 0.76 | |
| F-Score | 0.77 | 0.68 | 0.88 | 0.19 | 0.64 | 0.72 | |
| Support | 9,771 | 2,421 | 7,458 | 200 | 2,754 | 22,544 | |
| CFAEE-SCA-XGBoost | Precision |
| 0.79 | 0.91 | 0.89 | 0.86 |
|
| Recall |
|
|
|
|
|
| |
| F-Score |
|
|
|
|
|
| |
| Support | 9,771 | 2,421 | 7,458 | 200 | 2,754 | 22,544 |
Note:
The best achieved performance metric in all comparative analysis results tables are marked in bold.
Comparison of AP values for each class.
| XGBoost | PSO-XGBoost | FA-XGBoost | CFAEE-SCA-XGBoost | |
|---|---|---|---|---|
| Normal | 0.89 | 0.89 | 0.90 |
|
| Probe | 0.75 | 0.79 | 0.78 |
|
| Dos | 0.88 | 0.94 | 0.93 |
|
| U2R | 0.11 | 0.15 | 0.24 |
|
| R2L | 0.42 | 0.48 | 0.55 |
|
Note:
The best achieved performance metric in all comparative analysis results tables are marked in bold.
Figure 5PR curve of the basic XGBoost.
Figure 6PR curve of CFAEE-SCA-XGBoost.
Figure 7PR curve comparative analysis between CFAEE-SCA-XGBoost and the basic XGBoost.
XGBoost parameter values after optimisation by CFAEE-SCA.
| Parameter | Determined value | Description |
|---|---|---|
| eta | 0.95 | Learning rate |
| max_depth | 3 | Max depth |
| min_child_weight | 1.74 | Min leaf weight |
| gamma | 0.1 | Related to loss function |
| sub-sample | 0.6 | Controls sampling to prevent over-fitting |
| colsample_bytree | 0.88 s | Controls feature sampling proportions |
Machine learning methods’ parameter settings.
| Method | Parameters |
|---|---|
| ANN | Adam solver, single hidden layer, |
| LR | random state set to 10, maximum 1,000 iterations |
| kNN | multiple models, |
| SVM | regularisation parameter |
| DT | multiple models, |
Comparative results of binary classification by utilising all 42 features.
| Method | Acc training | Acc val | Acc test | Precision | Recall | F1-Score |
|---|---|---|---|---|---|---|
| ANN | 0.9448 | 0.9423 | 0.8670 | 0.8156 | 0.9803 | 0.8902 |
| LR | 0.9320 | 0.9286 | 0.7961 | 0.7331 | 0.9892 | 0.8424 |
| kNN | 0.9677 | 0.9357 | 0.8321 | 0.7916 | 0.9428 | 0.8603 |
| SVM | 0.7096 | 0.7062 | 0.6243 | 0.6089 | 0.8860 | 0.7117 |
| DT | 0.9366 | 0.9335 | 0.8811 | 0.8389 | 0.9648 | 0.9001 |
| XGBoost | 0.9526 | 0.9483 | 0.8712 | 0.8233 | 0.9824 | 0.8927 |
| PSO-XGBoost | 0.9713 | 0.9414 | 0.8914 | 0.8425 | 0.9894 | 0.9046 |
| FA-XGBoost | 0.9722 | 0.9427 | 0.8932 | 0.8457 | 0.9902 | 0.9061 |
| CFAEE-SCA-XGBoost |
|
|
|
|
|
|
Note:
The best achieved performance metric in all comparative analysis results tables are marked in bold.
Comparative results of multiclass classification by utilising 19 features.
| Method | Acc training | Acc val | Acc test | Precision | Recall | F1-Score |
|---|---|---|---|---|---|---|
| ANN | 0.7944 | 0.7890 | 0.7748 | 0.7949 | 0.7751 | 0.7725 |
| LR | 0.7252 | 0.7179 | 0.6527 | 0.7085 | 0.6526 | 0.6594 |
| kNN | 0.8267 | 0.7989 | 0.7232 | 0.7726 | 0.7232 | 0.7385 |
| SVM | 0.5358 | 0.5295 | 0.6151 | 0.5392 | 0.6150 | 0.5127 |
| DT | 0.7876 | 0.7845 | 0.6759 | 0.7967 | 0.6758 | 0.6927 |
| XGBoost | 0.7987 | 0.7903 | 0.7592 | 0.7931 | 0.7429 | 0.7528 |
| PSO-XGBoost | 0.8324 | 0.8016 | 0.7765 | 0.7993 | 0.7772 | 0.7756 |
| FA-XGBoost | 0.8347 | 0.8033 | 0.7784 | 0.8015 | 0.7796 | 0.7789 |
| CFAEE-SCA-XGBoost |
|
|
|
|
|
|
Note:
The best achieved performance metric in all comparative analysis results tables are marked in bold.
Comparative results of binary classification by utilising 19 features.
| Method | Acc training | Acc val | Acc test | Precision | Recall | F1-Score |
|---|---|---|---|---|---|---|
| ANN | 0.9377 | 0.9368 | 0.8441 | 0.7855 | 0.9852 | 0.8744 |
| LR | 0.8919 | 0.8924 | 0.7761 | 0.7316 | 0.9373 | 0.8218 |
| kNN | 0.9584 | 0.9471 | 0.8443 | 0.8028 | 0.9511 | 0.8709 |
| SVM | 0.7543 | 0.7553 | 0.6092 | 0.5893 | 0.9589 | 0.7299 |
| DT | 0.9413 | 0.9378 | 0.9086 | 0.8034 | 0.9841 | 0.8842 |
| XGBoost | 0.9516 | 0.9397 | 0.8478 | 0.7969 | 0.9788 | 0.8735 |
| PSO-XGBoost | 0.9599 | 0.9502 | 0.9121 | 0.8117 | 0.9859 | 0.8856 |
| FA-XGBoost | 0.9613 | 0.9514 | 0.9128 | 0.8134 | 0.9866 | 0.8873 |
| CFAEE-SCA-XGBoost |
|
|
|
|
|
|
Note:
The best achieved performance metric in all comparative analysis results tables are marked in bold.
Comparative results of multiclass classification by utilising all 42 features.
| Method | Acc training | Acc val | Acc test | Precision | Recall | F1-Score |
|---|---|---|---|---|---|---|
| ANN | 0.7988 | 0.7957 | 0.7559 | 0.7991 | 0.7557 | 0.7655 |
| LR | 0.7552 | 0.7395 | 0.6556 | 0.7693 | 0.6547 | 0.6663 |
| kNN | 0.8174 | 0.7681 | 0.7012 | 0.7578 | 0.7018 | 0.7202 |
| SVM | 0.5345 | 0.5271 | 0.6113 | 0.4749 | 0.6201 | 0.5378 |
| DT | 0.7766 | 0.7735 | 0.6601 | 0.7977 | 0.6604 | 0.5109 |
| XGBoost | 0.8155 | 0.7868 | 0.7395 | 0.7981 | 0.7264 | 0.7609 |
| PSO-XGBoost | 0.8216 | 0.7985 | 0.7592 | 0.8013 | 0.7611 | 0.7683 |
| FA-XGBoost | 0.8233 | 0.8007 | 0.7604 | 0.8028 | 0.7626 | 0.7698 |
| CFAEE-SCA-XGBoost |
|
|
|
|
|
|
Note:
The best achieved performance metric in all comparative analysis results tables are marked in bold.
Results comparison CEC2013 multimodal functions 6–20.
| FA | RGA | GSA | D-GSA | BH-GSA | C-GSA | AR-GSA | CFAEE-SCA | |
|---|---|---|---|---|---|---|---|---|
| F6 | ||||||||
| Best | 2.73E−01 | 7.79E+01 | 2.51E−01 | 5.58E−01 | 2.25E−01 |
| 3.72E−01 | 2.74E−01 |
| Median | 5.61E+01 | 1.12E+02 | 5.70E+01 | 7.16E+01 |
| 5.46E+01 | 1.74E+01 | 1.49E+01 |
| Worst | 9.56E+01 | 1.34E+02 | 9.46E+01 | 1.33E+02 |
| 1.03E+02 | 8.15E+01 | 7.59E+01 |
| Mean | 5.41E+01 | 1.14E+02 | 5.21E+01 | 7.39E+01 |
| 5.16E+01 | 3.39E+01 | 3.08E+01 |
| Std | 2.71E+01 |
| 2.53E+01 | 2.48E+01 | 2.71E+01 | 2.48E+01 | 2.68E+01 | 2.34E+01 |
| F7 | ||||||||
| Best | 2.75E+01 | 4.12E+01 | 2.78E+01 | 3.57E+01 | 4.48E−05 | 3.08E+01 | 4.33E−09 |
|
| Median | 4.62E+01 | 5.61E+01 | 4.43E+01 | 5.54E+01 | 5.28E−01 | 4.34E+01 | 2.62E−05 |
|
| Worst | 8.72E+01 | 6.83E+01 | 8.52E+01 | 9.08E+01 | 2.84E+01 | 7.41E+01 | 3.68E−03 |
|
| Mean | 5.05E+01 | 5.62E+01 | 4.68E+01 | 5.69E+01 | 5.64E+00 | 4.64E+01 | 1.53E−04 |
|
| Std | 1.58E+01 | 5.64E+00 | 1.22E+01 | 1.23E+01 | 7.65E+00 | 1.12E+01 | 5.24E−04 |
|
| F8 | ||||||||
| Best | 2.15E+01 | 2.12E+01 | 2.10E+01 | 2.10E+01 | 2.10E+01 | 2.10E+01 | 2.08E+01 |
|
| Median | 2.22E+01 | 2.10E+01 | 2.10E+01 | 2.10E+01 | 2.10E+01 | 2.11E+01 | 2.10E+01 |
|
| Worst | 2.29E+01 | 2.11E+01 | 2.11E+01 | 2.11E+01 | 2.11E+01 | 2.15E+01 | 2.11E+01 |
|
| Mean | 2.20E+01 | 2.10E+01 | 2.10E+01 | 2.10E+01 | 2.10E+01 | 2.13E+01 | 2.10E+01 |
|
| Std | 5.63E−02 | 4.69E−02 | 4.81E−02 | 5.32E−02 | 5.64E−02 | 1.61E−01 | 7.15E−02 |
|
| F9 | ||||||||
| Best | 2.44E+01 | 1.61E+01 | 2.12E+01 | 2.09E+01 | 3.26E+00 | 2.01E+01 | 2.37E−07 |
|
| Median | 3.02E+01 | 2.12E+01 | 2.76E+01 | 3.04E+01 | 7.18E+00 | 2.84E+01 | 5.02E+00 |
|
| Worst | 3.96E+01 | 2.69E+01 | 3.49E+01 | 3.78E+01 | 1.49E+01 | 3.70E+01 | 8.92E+00 |
|
| Mean | 2.90E+01 | 2.14E+01 | 2.79E+01 | 3.03E+01 | 7.82E+00 | 2.85E+01 | 5.23E+00 |
|
| Std | 3.73E+00 | 2.34E+00 | 3.55E+00 | 3.93E+00 | 2.46E+00 | 3.62E+00 | 1.97E+00 |
|
| F10 | ||||||||
| Best | 0.00E+00 | 3.56E+01 | 0.00E+00 | 1.23E+00 | 5.70E−13 | 3.39E−13 | 0.00E+00 | 0.00E+00 |
| Median | 5.48E−14 | 5.94E+01 | 5.70E−14 | 1.51E+00 | 1.20E−12 | 7.39E−03 | 0.00E+00 | 0.00E+00 |
| Worst | 2.19E−02 | 6.99E+01 | 2.20E−02 | 2.19E+00 | 1.74E−02 | 2.98E−02 | 1.52E−02 |
|
| Mean | 5.68E−03 | 5.89E+01 | 5.56E−03 | 1.61E+00 | 2.54E−03 | 7.42E−03 | 1.72E−03 |
|
| Std | 6.59E−03 | 6.74E+00 | 6.41E−03 | 2.72E−01 | 5.03E−03 | 6.05E−03 | 3.85E−03 |
|
| F11 | ||||||||
| Best | 1.42E+02 | 1.12E+02 | 1.31E+02 | 1.29E+02 | 8.97E+00 | 1.41E+02 | 7.98E+00 |
|
| Median | 1.83E+02 | 1.46E+02 | 1.85E+02 | 1.87E+02 |
| 1.83E+02 | 1.81E+01 | 1.86E+01 |
| Worst | 2.66E+02 | 1.64E+02 | 2.33E+02 | 2.29E+02 | 3.40E+01 | 2.36E+02 | 2.99E+01 |
|
| Mean | 1.99E+02 | 1.46E+02 | 1.90E+02 | 1.86E+02 | 1.80E+01 | 1.85E+02 | 1.85E+01 |
|
| Std | 2.55E+01 | 9.18E+00 | 2.38E+01 | 2.20E+01 | 5.19E+00 | 2.14E+01 | 4.50E+00 |
|
| F12 | ||||||||
| Best | 1.73E+02 | 1.44E+02 | 1.59E+02 | 1.54E+02 |
| 1.49E+02 | 1.32E+01 | 1.08E+01 |
| Median | 2.19E+02 | 1.60E+02 | 2.11E+02 | 2.11E+02 |
| 2.04E+02 | 2.32E+01 | 2.08E+01 |
| Worst | 2.74E+02 | 1.73E+02 | 2.61E+02 | 2.64E+02 |
| 2.64E+02 | 3.89E+01 | 3.59E+01 |
| Mean | 2.24E+02 | 1.59E+02 | 2.09E+02 | 2.11E+02 |
| 2.08E+02 | 2.34E+01 | 2.19E+01 |
| Std | 2.89E+01 | 8.68E+00 | 2.74E+01 | 2.41E+01 |
| 2.38E+01 | 5.43E+00 | 5.28E+00 |
| F13 | ||||||||
| Best | 2.52E+02 | 1.32E+02 | 2.77E+02 | 2.48E+02 | 5.15E+00 | 2.42E+02 | 1.17E+01 |
|
| Median | 3.55E+02 | 1.60E+02 | 3.29E+02 | 3.24E+02 | 2.52E+01 | 3.35E+02 | 4.12E+01 |
|
| Worst | 4.61E+02 | 1.70E+02 | 4.31E+02 | 4.26E+02 | 6.16E+01 | 4.08E+02 | 8.76E+01 |
|
| Mean | 3.61E+02 | 1.59E+02 | 3.32E+02 | 3.29E+02 | 2.78E+01 | 3.31E+02 | 4.49E+01 |
|
| Std | 3.51E+01 | 7.03E+00 | 3.34E+01 | 3.80E+01 | 1.30E+01 | 3.97E+01 | 1.81E+01 |
|
| F14 | ||||||||
| Best | 2.24E+03 | 4.38E+03 | 2.21E+03 | 2.48E+03 | 1.07E+03 | 2.19E+03 | 7.82E+02 |
|
| Median | 3.56E+03 | 5.02E+03 | 3.27E+03 | 3.39E+03 | 1.66E+03 | 3.31E+03 | 1.48E+03 |
|
| Worst | 4.42E+03 | 5.62E+03 | 4.31E+03 | 4.32E+03 | 2.59E+03 | 4.57E+03 | 2.49E+03 |
|
| Mean | 3.52E+03 | 5.08E+03 | 3.33E+03 | 3.35E+03 | 1.65E+03 | 3.43E+03 | 1.51E+03 |
|
| Std | 4.98E+02 | 2.64E+02 | 5.02E+02 | 4.22E+02 | 3.26E+02 | 4.86E+02 | 3.78E+02 |
|
| F15 | ||||||||
| Best | 2.52E+03 | 4.57E+03 | 2.41E+03 | 2.15E+03 | 5.14E+02 | 2.31E+03 | 5.32E+02 |
|
| Median | 3.45E+03 | 5.29E+03 | 3.28E+03 | 3.34E+03 | 1.22E+03 | 3.17E+03 | 1.19E+03 |
|
| Worst | 4.93E+03 | 5.96E+03 | 4.70E+03 | 5.00E+03 | 2.26E+03 | 4.12E+03 |
| 2.29E+03 |
| Mean | 3.56E+03 | 5.30E+03 | 3.34E+03 | 3.39E+03 | 1.24E+03 | 3.32E+03 | 1.24E+03 |
|
| Std | 5.76E+02 | 2.89E+02 | 5.44E+02 | 4.95E+02 | 3.88E+02 | 4.53E+02 | 3.32E+02 |
|
| F16 | ||||||||
| Best | 4.35E−04 | 1.94E+00 |
| 7.00E−01 | 6.06E−04 | 6.05E−04 | 5.52E−04 | 5.34E−04 |
| Median | 2.32E−03 | 2.49E+00 | 2.12E−03 | 1.14E+00 | 3.31E−03 | 2.58E−03 |
| 2.23E−03 |
| Worst | 9.68E−03 | 3.04E+00 | 9.41E−03 | 1.74E+00 | 1.15E−02 |
| 1.03E−02 | 1.32E−02 |
| Mean | 2.82E−03 | 2.47E+00 | 2.85E−03 | 1.13E+00 | 3.99E−03 | 3.46E−03 | 2.74E−03 |
|
| Std | 2.39E−03 | 2.74E−01 | 2.18E−03 | 2.25E−01 | 2.30E−03 | 2.26E−03 | 1.86E−03 |
|
| F17 | ||||||||
| Best | 3.74E+01 | 1.93E+02 | 3.75E+01 | 7.44E+01 | 3.72E+01 | 3.61E+01 | 4.09E+01 |
|
| Median | 4.35E+01 | 2.10E+02 | 4.45E+01 | 1.03E+02 | 4.59E+01 |
| 5.03E+01 | 4.56E+01 |
| Worst | 6.68E+01 | 2.34E+02 | 6.72E+01 | 1.26E+02 |
| 5.72E+01 | 6.52E+01 | 7.69E+01 |
| Mean | 4.73E+01 | 2.12E+02 | 4.49E+01 | 1.03E+02 | 4.64E+01 |
| 5.03E+01 | 4.52E+01 |
| Std | 5.45E+00 | 9.39E+00 | 5.06E+00 | 1.09E+01 | 4.11E+00 | 4.39E+00 | 5.29E+00 |
|
| F18 | ||||||||
| Best | 3.85E+01 | 1.84E+02 | 3.65E+01 | 1.34E+02 | 3.95E+01 | 3.74E+01 | 4.15E+01 |
|
| Median | 4.74E+01 | 2.11E+02 | 4.54E+01 | 1.72E+02 | 4.72E+01 |
| 5.53E+01 | 4.48E+01 |
| Worst | 5.93E+01 | 2.30E+02 | 5.36E+01 | 1.98E+02 | 5.92E+01 | 5.88E+01 | 7.13E+01 |
|
| Mean | 4.86E+01 | 2.11E+02 | 4.54E+01 | 1.75E+02 | 4.72E+01 | 4.58E+01 | 5.59E+01 |
|
| Std | 3.92E+00 | 8.89E+00 | 3.76E+00 | 1.43E+01 | 4.04E+00 | 4.24E+00 | 7.11E+00 |
|
| F19 | ||||||||
| Best | 1.75E+00 | 2.17E+01 | 1.79E+00 | 4.33E+00 | 2.77E+00 |
| 2.56E+00 | 2.29E+00 |
| Median | 2.69E+00 | 2.54E+01 |
| 6.48E+00 | 4.59E+00 | 3.04E+00 | 3.55E+00 | 3.63E+00 |
| Worst | 4.08E+00 | 2.92E+01 |
| 1.55E+01 | 6.25E+00 | 4.44E+00 | 6.86E+00 | 6.89E+00 |
| Mean | 2.82E+00 | 2.53E+01 |
| 7.26E+00 | 4.69E+00 | 3.02E+00 | 3.85E+00 | 3.89E+00 |
| Std | 6.82E−01 | 1.59E+00 | 6.78E−01 | 2.76E+00 | 9.54E−01 |
| 8.87E−01 | 8.49E−01 |
| F20 | ||||||||
| Best | 1.66E+01 | 1.50E+01 | 1.42E+01 |
| 1.50E+01 | 1.50E+01 | 1.48E+01 | 1.45E+01 |
| Median | 1.67E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 |
| Worst | 1.69E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 |
| Mean | 1.68E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 | 1.50E+01 |
| Std | 1.46E−01 | 9.94E−06 | 1.34E−01 | 1.83E−01 | 6.29E−08 | 3.11E−06 | 1.99E−02 |
|
Note:
The best obtained results for each metric are marked in bold.