Next Article in Journal
A Comparison of Off-Chip Differential and LC Input Matching Baluns in a Wideband and Low-Power RF-to-BB Current-Reuse Receiver Front-End
Previous Article in Journal
Equilibrium Approximating and Online Learning for Anti-Jamming Game of Satellite Communication Power Allocation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Application of Improved Butterfly Optimization Algorithm Combined with Black Widow Optimization in Feature Selection of Network Intrusion Detection

School of Computer Science, Hubei University of Technology, Wuhan 430068, China
*
Author to whom correspondence should be addressed.
Electronics 2022, 11(21), 3531; https://doi.org/10.3390/electronics11213531
Submission received: 17 September 2022 / Revised: 15 October 2022 / Accepted: 19 October 2022 / Published: 29 October 2022
(This article belongs to the Section Networks)

Abstract

:
Feature selection is a very important direction for network intrusion detection. However, current feature selection technology of network intrusion detection has the problems of low detection rate and low accuracy due to feature redundancy. An improved Butterfly Optimization Algorithm combined with Black Widow Optimization (BWO-BOA) is proposed in this paper, which introduces a dynamic adaptive search strategy in the global search phase of the Butterfly Optimization Algorithm (BOA), uses the movement search process of Black Widow Optimization (BWO) algorithm as the local search, and at the same time, in order to overcome the improved butterfly optimization algorithm easily falling into a local optimum in local search phase, takes advantage of the small probability mutation strategy to filter out the redundant features. This paper then tries to apply the proposed BWO-BOA algorithm to feature selection of network intrusion detection. In order to verify the performance of the proposed BWO-BOA algorithm, the UNSW-NB15 dataset is selected for binary classification and multi-classification simulation experiments, and the feature selection models of BWO-BOA algorithm, BOA algorithm, BWO algorithm, Particle Swarm Optimization, Salp Swarm Algorithm, Whale Optimization Algorithm and improved Butterfly Optimization Algorithm are compared for validation. The experimental results show that the proposed BWO-BOA algorithm can enhance the performance of the feature selection model in network intrusion detection and significantly boost the reduction of feature dimensions.

1. Introduction

In recent years, the frequent occurrence of network security incidents, the diversification of intrusion methods and the increasing frequency of intrusions led to the challenges of low accuracy of abnormal traffic detection and identification and classification of existing network intrusion detection technologies. Network intrusion detection models are based on intrusion detection algorithms and network datasets [1]. Network datasets usually include false positives, irrelevant and redundant features, which not only slow down the detection speed, but also consume a lot of computing resources. Feature selection is the process of selecting the most relevant features that help build robust models [2,3,4]. It is not only used in breast cancer detection and coronary heart disease detection, but is also an important step for data preprocessing in intrusion detection [5,6,7,8]. Although it reduces processing costs and minimizes storage space, it faces significant challenges in terms of dimension disasters and classification accuracy [9].
Swarm intelligence optimization is widely used for feature selection in intrusion detection systems because of its high accuracy [10]. In this context, swarm intelligence is an important technology for implementation and classification. A variety of intelligent optimization algorithms are used in feature selection of network intrusion detection, such as the Moth Flame Optimization (MFO) algorithm [11], Ant Colony Optimization (ACO) algorithm [12], Cuckoo Search (CS) [13], Butterfly Optimization Algorithm (BOA) [14,15], Firefly Algorithm (FA) [16,17,18,19], Krill Herd Algorithm [20], Sparrow Search Algorithm (SSA) [21], Artificial Bee Colony (ABC) algorithm [22], Salp Swarm Algorithm (SSA) [23] and Gray Wolf Optimization (GWO) algorithm [24], etc. However, due to the limitations of a single swarm intelligence algorithm, there are many measures to improve the swarm intelligence algorithm, such as changing the initialization mode to increase randomness, using mutations to accelerate the convergence speed or making a fine-grained search strategy [25,26,27,28]. At the same time, an increasing number of scholars choose a hybrid algorithm, which synergizes the characteristics of different algorithms; for example, Mojtahedi proposed that the application of a combined genetic algorithm and whale optimization algorithm in feature selection to enhance the accuracy of network intrusion detection [29]. Yuan et al. put forward the combination of a genetic algorithm and improved ant colony algorithm for feature extraction [30]. Xu et al. fused cuckoo search and the gray wolf optimization algorithm to increase the global search ability of feature selection for network intrusion detection [31]. Kang et al. proposed the application and feature selection problems of a hybrid improved flower pollination algorithm and gray wolf algorithm [32]. Therefore, in the field of feature selection, combination algorithms perform better than single algorithms.
Based on the idea of applying these algorithms to improve the network intrusion detection system, this paper selects the Butterfly Optimization Algorithm (BOA) [33] and Black Widow Optimization (BWO) algorithm [34], which have complementary advantages. The BOA has a simple structure and easy realization, but it also has the problems of slow convergence and easily falling into the local optimum. The BWO algorithm is linear and spiral in the way of motion, which can carry out a fine-grained search to prevent the algorithm from falling into the local optimum. This paper proposes a new algorithm to improve the Butterfly Optimization Algorithm combined with Black Widow Optimization (BWO-BOA), according to the characteristics of the BOA algorithm and the BWO algorithm. The new algorithm can improve the problems of easily to falling into local optima and slow convergence, and thus has some advantages in the feature selection model.
The main contributions of this paper are as follows: The BWO-BOA algorithm is proposed. Based on the BOA framework, the BWO-BOA algorithm makes the following improvements. Firstly, the BOA is improved by using the dynamic adaptive search strategy, the search strategy of the BWO algorithm and small probability mutation strategy to enhance the convergence speed and the global optimization ability of the algorithm. Then, the intrusion detection model of the improved algorithm is tested with the UNSW-NB15 dataset. Simulation results and experimental analysis verify the effectiveness of the proposed model.

2. Basic Algorithms

2.1. Butterfly Optimization Algorithm (BOA)

The BOA is derived by simulating a butterfly to analyze the odors in the air to locate a food source. Each butterfly has a different fragrance. Butterflies can smell and analyze the fragrance of other butterflies in the air to determine the direction of movement to the global optimal position. The intensity of the fragrance depends on the fitness of the butterfly itself, and the fitness of the butterfly constantly changes during its movement. The expression for fragrance concentration is shown in Equation (1).
f i = c I a ,
where f i is the fragrance concentration and c is the perceptual form. I is the stimulus intensity and the I value is determined by the fitness of the current butterfly individual. a represents the power index of the dependent perception form.
Due to the mutual attraction of the fragrances between the butterflies, the location of the best butterfly is the one with the largest fragrance. If the fragrance concentration is strong, the butterflies move towards the best location. This phase is called global search. Conversely, when the butterfly is not sensitive to the smell, the direction of movement is not specified, this phase is called local search. In the process of population movement, the conversion probability p determines the search phase. In each iteration, r a n d is generated and compared with the conversion probability p . If the r a n d is lower than p , a global search is performed; otherwise, a local search is performed.
In the global search phase, the butterfly moves towards the global optimal position, and the updated position is shown in Equation (2).
x i t + 1 = x i t + ( r 2 × g * - x i t ) × f i ,
where x i t is the position of the i -th butterfly in the t -th iteration, the range of r is [0, 1], x i t + 1 is the updated butterfly position, g * indicates that the position of the butterfly is the global optimum and f i is the intensity of fragrance emitted by the i -th butterfly.
During the local search phase, the butterfly randomly moves its position, and the position update formula is as follows.
x i t + 1 = x i t + ( r 2 × x j t - x k t ) × f i ,
where x j t and x k t stand for two butterflies randomly selected from the same population. The r is in the range of [0, 1].

2.2. Black Widow Optimization (BWO) Algorithm

The BWO algorithm is a swarm intelligence algorithm proposed by Peña-Delgado et al. in 2020, which is inspired by mating behavior of black widow spiders. The western black widow spider is a poisonous spider found from western Canada to southern Mexico. The body of female black widows contains a powerful neurotoxin. In addition, the neurotoxin is one of the most dangerous to humans, as a single bite can lead to death. Black widow spiders feed on insects such as cockroaches, beetles and butterflies; they weave webs in trees and inhabit forests and swamps. Males use sex pheromones to identify mating patterns of females, and they are not interested in hungry or malnourished females, because females exhibit cannibalism. Black widow spiders have two strategies: the movement strategy and the pheromone strategy.
Movement strategy: the movement of a black widow spider on a web is simulated as linear and spiral, using the optimal position of the current black widow spider to move in a linear and spiral manner, with a conversion probability of 0.3.
Pheromone strategy: after normalized pheromone processing, if the pheromone is below or equal to 0.3, the spider is replaced by other spiders.

3. Proposed BWO-BOA Algorithm

The BWO-BOA algorithm improves three areas based on the BOA framework. Firstly, a dynamic adaptive search strategy is introduced to improve the global search ability of the BOA algorithm, which balances the whole search ability of the global search. Then, the local search phase is improved by fusing the movement strategy of the BWO algorithm to search more precisely. Finally, the small probability mutation strategy and the pheromone strategy of the BWO algorithm are used to update the location of the algorithm to avoid the algorithm falling into the local optimum, which improves the global search ability of the algorithm.

3.1. Dynamic Adaptive Search Strategy

Due to the slow convergence speed and poor precision of the algorithm when the butterfly searches for the optimal solution, this paper randomly distributes the population every time and balances the global and local search ability of the algorithm by improving the fragrance formula and introducing the inertia weight. Since the improved fragrance formula and the inertia weight formula dynamically adapt the search ability of the algorithm, this paper is collectively called the dynamic adaptive search strategy.
In the BOA, the intensity of fragrance directly affects the range of the butterfly search, and a change of I in the fragrance intensity calculation formula is determined by the value of fitness; the curve slope of the fitness affects the convergence speed and the solution precision of the algorithm. In order to make the global search more efficient, the formula for fragrance concentration is improved by using an improved fragrance formula search strategy, such as (4).
f = r a n d × ( 4 - 4 t N i t e r ) + 2 t N i t e r - 2 ,
where r a n d is in the range of [0, 1]. In the iterative process, f can dynamically adapt the search ability of the early and late phases of the algorithm, help the algorithm to find the global optimum quickly and improve the solving ability of the algorithm.
Although the overall convergence ability of the algorithm is enhanced after improving the fragrance concentration formula, the accuracy and convergence ability of the algorithm still cannot reach the expectation in the optimization process. Hence, this paper introduces the inertia weight search strategy to balance the global and local search ability of the algorithm and strengthen the optimization and convergence ability of the algorithm. Adaptive hybrid inertia weights were introduced in [35,36] to improve the search capability of the algorithm in the early and late phases, and nonlinear inertia weights were introduced in [37,38]. This paper introduces the inertia weight search strategy to dynamically adapt the algorithm to the overall search ability, using the inertia weight ω calculation as shown in Equation (5).
ω ( t ) = 2 × e x p ( - ( 4 × t N i t e r ) 2 ) ,
where e x p is an exponential function. The ω has a wide change range and big change of slope; a search in a wide range in the initial phase and the range is smaller and smaller with the number of iterations changing after introducing ω , which is helpful to enhance the convergence ability of the algorithm. The global search position update formula after introducing ω is as Equation (6).
x i t + 1 = ω ( t ) × x i t + ( r 2 × g * - x i t ) × f

3.2. Black Widow Search Strategy

This paper uses the movement strategy of the BWO algorithm to improve the local search formula of the BOA and uses a 0.3 conversion probability to decide whether the local search should be a linear search or spiral search. The conversion probability p is changed to 0.5, which makes the local search process more precise, thus greatly improving the local development ability and convergence ability of the algorithm. The local position update formula after improving is as follows.
x i t + 1 = { g * - μ x l t , r a n d > p 1 g * - c o s ( 2 π θ ) x i t , o t h e r s ,
where p 1 is 0.3, the variable μ is a floating-point number randomly generated in [0.4, 0.9], l is an individual randomly selected from the population ( l not equal i ) and θ is a random floating-point number from [−1.0, 1.0].
Although this paper uses the movement search strategy of the BWO algorithm to improve the local search ability of the BOA, only the movement strategy makes the algorithm easily fall into the local optimal. Genetic algorithms have individual variation; the probability of a small mutation can prevent the phenomenon of convergence of the algorithm too early [39]. In this paper, p 2 is used to represent the probability of variation, the value of p 2 is 0.1, so there is a 90% probability of no mutation in the algorithm, and the remaining 10% is the probability of mutation; this strategy is called the small probability mutation strategy.
This paper introduces a small probability mutation strategy, which helps move out of the local optimal to the global optimal solution and improves the ability of local convergence. The exploration mode of the local search phase is determined by p 2 , using the low pheromone substitution strategy of the pheromone strategy in the BWO algorithm to update the butterfly position. The position after mutation is as follows.
x i t + 1 = g * + 1 2 [ x j t - ( - 1 ) σ × x k t ] ,
where σ is a random binary number randomly generated, σ {0, 1}.

3.3. Pseudo-Code of BWO-BOA Algorithm

The pseudocode for BWO-BOA is shown in Algorithm 1.
Algorithm 1: BWO-BOA pseudocode.
Initialize population N , iteration times T , Dimension D , upper and lower bounds and parameters.
1: Calculate the fitness of each butterfly and record the optimal position.
2: while ( t < T )
3:  for i < N
4:   Calculate f and ω ( t ) , respectively, using Equations (4) and (5).
5:   if rand< p
6:    Update the global position with Equation (6).
7:   else
8:    if rand< p 2
9:     Update local position with Equation (7).
10:    else
11:     The position of the mutation is updated with Equation (8).
12:    end if
13:   end if
14:  end for
15: end while
16: Output the optimal value.
The BWO-BOA is based on improving the BOA framework, which is mainly divided into three steps. In the first step, the dynamic adaptive search strategy is introduced into the BOA, which utilizes the improved fragrance formula and inertia weight to dynamically adapt the search ability of the BOA in the early and late phases, causing the algorithm to achieve a balanced and coordinated overall search ability. The second step is to update the position of the butterfly in the local search process of the improved BOA by incorporating a movement strategy of the BWO, which makes the local search process more precise and changes the conversion probability p from 0.8 to 0.5, to increase the probability of the local search process, so as to increase the ability of local search process. Lastly, in order to avoid the algorithm falling into the local optimum and improve the local search ability of algorithm, this paper uses a small probability mutation probability and utilizes the low pheromone substitution strategy of the BWO to update the position of the mutated butterfly. The flow chart of the BWO-BOA algorithm is shown in Figure 1.
In conclusion, after three steps of improvement, the BWO-BOA algorithm effectively enhances the search ability, improves the ease with which the original BOA fall into the local optimal and balances the search process of the earlier and later phases; the overall performance of the algorithm has been greatly improved.

4. Feature Selection Model Based on BWO-BOA Algorithm for Network Intrusion Detection

Feature selection is a kind of preprocessing technology to remove the irrelevant, noisy and redundant feature data, mainly by finding the best feature subset from the original feature set to reduce the dimensionality of data processing, decrease the computational pressure of storage and enhance the classification performance of the model.

4.1. Fitness Function

Since the number of selected features is not as small as possible, to ensure the best effect of the feature selection model, the fitness function should effectively integrate the classification accuracy and the number of selected features. To balance the highest possible classification accuracy with the lowest possible number of features, the fitness function is set as follows.
f i t n e s s = α × e r r o r + β × n u m _ f e a t m a x _ f e a t ,
e r r o r = 1 - A c c u r a c y ,
where the e r r o r represents the classification error rate and α and β denote the weight of the error rate and the feature subset, respectively. In this paper, α is taken as 0.99 and β = 1 - α . n u m _ f e a t is the length of the selected feature and m a x _ f e a t is the total length of the dataset features.

4.2. Evaluation Indicators

In this paper, the accuracy rate ( A c c ), precision rate ( P r e ), recall rate ( R e c ) and F1 score ( F 1 ) are used as the indicators of feature selection model evaluation. A c c refers to the prediction accuracy of the classification of sample data, P r e refers to the ratio of the data with positive results to the data predicted to be positive, R e c refers to the ratio of the predicted positive samples to the actual positive results and the F 1 refers to both the precision rate and the recall rate so that a balance between the two can obtain an optimal result. The evaluation indicators are calculated as follows.
A c c = T P + T N T P + T N + F P + F N ,
P r e = T P T P + F P ,
R e c = T P T P + F N ,
F 1 = 2 × P r e × R e c P r e + R e c ,
where T P means that the positive class of the sample is predicted to be a positive class (True Positive), T N means that the negative class of the sample is predicted to be a negative class (True Negative), F P means that the negative class of the sample is predicted to be a positive class (False Positive) and F N means that the positive class of the sample is predicted to be a negative class (False Negative).

4.3. Proposed Feature Selection Model Based on BWO-BOA Algorithm

As for network intrusion detection, the proposed BWO-BOA algorithm is utilized for feature selection, which not only ensures the accuracy of feature selection and extraction of key features, but also reduces the interference of redundant features. The feature selection model based on the BWO-BOA algorithm is shown in Figure 2.
As is indicated in Figure 2, the steps of feature selection based on the BWO-BOA algorithm are as follows.
Step1: Data preprocessing is performed on the test and training sets of the dataset.
Step2: Initialize the population and related parameters of the BWO-BOA. Use the evaluation function fitness to find out the feature subset selected by the optimal individual in the BWO-BOA algorithm.
Step3: Input the optimal feature subset into the classifier for classification.
Step4: Output the A c c , P r e , R e c , F 1 and selected feature subset of the model.

5. Experimental Results

The simulation experiment environment in this paper is a 64-bit Windows 10 operating system, the main frequency of the machine is 3.30 GHz, the memory is 16 GB, and the algorithm is implemented by using the Sklearn library in Python 3.10.
For the sake of verifying the effectiveness of the feature selection model based on the BWO-BOA algorithm proposed in this paper, this paper uses the UNSW-NB15 dataset to conduct simulation experiments on the KNN classifier [25,40,41,42]. The average classification accuracy, average classification precision, average recall rate, average F1-score and average optimal feature subset are evaluated. In order to fully verify the effectiveness of the algorithm in this paper, the BWO-BOA algorithm is compared with the original BOA, BWO algorithm, Particle Swarm Optimization (PSO) [43], Salp Swarm Algorithm (SSA) [44], Whale Optimization Algorithm (WOA) [45] and the improved butterfly optimization algorithm using Gaussian mutation and dynamic variance (IBOA) [27]. In the simulation experiments, the population size was set to 20, the maximum number of iterations was 50, and each feature selection model was independently run 20 times on the dataset. The rest of the algorithm parameters are shown in Table 1.

5.1. Dataset

The dataset for this experiment is the UNSW-NB15 dataset, the original data of which were created by the Ixia PerfectStorm tool, and the file type is saved in CSV format. The dataset contains 10 behavior categories, one of which is normal behavior and the other nine are attack behavior; the nine types of attacks are Fuzzers, Analysis, Backdoors, Dos, Exploits, Generic, Reconnaissance, Shellcode and Worms [46]. The dataset was divided into the training set and test set. There are 175,341 data in the training set and 82,332 in the test set. Since it lacks Shellcode attack, there are only eight attack types, and each data point has 45 features, including id and its label. The specific feature names are shown in Table 2.
The original dataset contains data that affect the effect of simulation experiments, so data preprocessing is required. Data preprocessing includes the following three steps.
(1) Data cleaning
The ‘service’ column in the dataset represents the type of communication service, including ‘HTTP’, ‘FTP’, ‘SMTP’, ‘SSH’, ‘DNS’, ‘-‘. Where ‘-‘ represents a protocol that the model cannot recognize, it was replaced by a null value during processing in this paper. Rows with null values are deleted when cleaning data so they do not affect results. There are 94,168 rows with null values in the training set, and 81,173 records after processing, 47,153 rows with null values in the test set, and 35,179 records after processing.
(2) Data mapping
The ‘proto’, ‘state’ and ‘service’ features in the UNSW-NB15 dataset are strings, which cannot be recognized by the detection model, so feature mapping is implemented with one-hot encoding pairs. The values of ‘proto’ are ‘TCP’ and ‘UDP’. After one-hot encoding mapping, they are 01 and 10, respectively. The values of ‘state’ are ‘CON’, ‘FIN’, ‘INT’, ‘REQ’ and ‘RST’. After mapping, they are 10000, 01000, 00100, 00010 and 00001 respectively. In addition, values of ‘service’ are ‘snmp’, ‘smtp’, ‘ftp’, ‘irc’, ‘pop3’, ‘ssh’, ‘http’, ‘radius’, ‘ftp-data’, ‘ssl’, ‘dhcp’ and ‘dns’; the corresponding codes after mapping are no longer listed. The three feature subsets become 19 columns after one-hot encoding; hence, removed the id column, there are 60 columns per row of the dataset.
(3) Normalization
The values between the features in the dataset are in different ranges, which affects the accuracy of the model. In order to ensure that the features are in the same index range, this paper adopts data normalization processing to map the data in the range of [0, 1]. The processing formula is as follows.
Z * = Z - Z m i n Z m a x - Z m i n ,
where Z * is the normalized data, Z is the original data and Z m a x and Z m i n are the maximum and minimum values of the data, respectively.

5.2. Comparative Analysis of Feature Selection Models with Different Improvements in BWO-BOA Algorithm

In order to test the effectiveness of different strategies and their influence on the classification accuracy of the feature selection model, the original BOA is compared with the BOA with a dynamic adaptive search strategy (BOA1), the BOA1 and the movement strategy of BWO algorithm are combined (BOA2) and the small probability mutation strategy and updating the position by using the pheromone strategy in BWO algorithm are introduced to the BOA2 (BWO-BOA). A c c , P r e , R e c and F 1 in the following tables are the averages of 20 times, and n is the feature mean selected for each model.

5.2.1. Comparative Analysis of Different Improvements in Binary Classification and Multi-classification

The results of binary classification and multi-classification tests with 5% of the training set and 5% of the test set are shown in the following table. Table 3 shows the results of binary classification tests with different improvement strategies. Table 4 shows the results of different improvement strategies on multi-classification.
Through the comparison of several indicators— A c c , P r e , R e c and F 1 —in Table 3, it can be seen that the improvement of different strategies affects the feature selection model. The BOA1 that introduces the dynamic adaptive search strategy in the binary classification has different degrees of improvement in P r e and R e c than the original BOA, and the number of selected features is also reduced. At the same time, BOA2, after integrating the movement strategy of the BWO algorithm, has a great improvement in A c c , P r e , R e c and F 1 compared with the BOA and BOA1. The classification accuracy of the model after integrating the movement strategy of BWO algorithm is improved from 94.37% to 96.23%, which indicates the classification accuracy and classification efficiency of the feature selection model can be effectively improved. The feature subset selected by the BWO-BOA is eight, which is the best one among the four algorithms. It shows that the introduction of the small probability mutation strategy and the use of the BWO algorithm pheromone strategy to update the position have obvious effects on reducing the redundancy of the feature selection subset.
From the analysis in Table 4, the BWO-BOA has the highest overall classification accuracy, followed by the BOA2, BOA1 and BOA, which indicates that the integration of different improvement strategies can improve the classification accuracy of the model. In addition to ‘Backdoor’ and ‘Reconnaissance’ attacks, compared with the BOA, the BOA1 improves the classification accuracy of other types of attacks, which shows the effectiveness of the dynamic adaptive search strategy. The BOA2 not only improves the classification accuracy of attack types other than ‘Normal’, but also detects ‘Backdoor’ attacks that the BOA and BOA1 cannot detect, which demonstrates the integration of the movement strategy of the BWO algorithm can effectively improve the detection efficiency of multi-classification. The BWO-BOA improves the classification accuracy of ‘Dos’, ‘Fuzzers’, ‘Generic’ and ‘Worms’ attacks, which illustrates the introduction of a small probability mutation strategy and the use of the pheromone strategy of the BWO algorithm to update the location can also improve the classification efficiency of multi-classification.

5.2.2. Comparison of Fitness for Different Strategies

For the purpose of observing the effect of different improvement strategies more intuitively, this paper makes a comparison of the fitness for different strategies in 50 iterations. Figure 3a shows the fitness of different strategies in binary classification, and Figure 3b shows the fitness of different strategies in multi-classification.
From Figure 3, the order of fitness is BWO-BOA, BOA2, BOA1, BOA; it is shown that fusing each strategy into the BOA algorithm can improve the classification accuracy of the model and reduce the number of features selected.
Based on the above analysis, this paper introduces a dynamic adaptive search strategy to balance the ability of early and late searches in the global search and enhance the classification accuracy of the model. At the same time, the movement strategy of BWO is integrated to improve the local search process and further improve the classification accuracy and efficiency of the model; furthermore, the location updating strategy of small probability mutation and pheromone strategy of BWO improved the global search ability of the algorithm and then reduced the redundancy of feature subset selected by the model.

5.3. Comparative Experimental Results of Different Algorithms

To verify the effectiveness of the model proposed in this paper, the model is compared and analyzed with the six algorithms—BOA, BWO, PSO, SSA, WOA and IBOA—used in feature selection. Since the dataset is too large, this paper takes 5%, 10%, 20% and 30% of the training set and test set, respectively, for simulation experiments. A c c , P r e , R e c and F 1 in the following tables are the averages of 20 times, and n is the average number of features selected by each model.

5.3.1. Comparative Analysis of Binary Classification Results

Table 5, Table 6, Table 7 and Table 8 are the binary classification results of the seven algorithms on 5%, 10%, 20% and 30% of the datasets, respectively. It can be seen from the observation that the feature selection model of the proposed algorithm is better than other algorithms in terms of A c c , P r e , R e c and F 1 , and compared with the original BOA and BWO algorithms, the result of the feature selection model is greatly improved. For example, with 30% of the dataset, compared with BWO, the BWO-BOA improved A c c , P r e , R e c and F 1 by 0.18%, 0.24%, 0.23% and 0.23%, respectively. This shows that the BWO-BOA algorithm with the Black Widow search strategy is better than the original BOA and BWO algorithms. Compared with the IBOA, the number of features selected by the BWO-BOA is similar, but the A c c , P r e , R e c and F 1 of the BWO-BOA are higher than those of the IBOA algorithm. It also further shows that the application of the BWO-BOA in the feature selection model can improve its classification accuracy and precision and has a good classification effect in data preprocessing.
To intuitively observe the effect of the BWO-BOA in the feature selection model, Figure 4a is a line chart comparing the average classification accuracy of the seven algorithms in the binary classification. The average accuracy of the BWO-BOA on the feature selection model is higher than that of other algorithms on four datasets, which shows that the proposed algorithm has some advantages over other algorithms in the feature selection model.
Figure 4b shows the average number of feature subsets selected by the seven algorithms in the four datasets. It can be seen that, although the average number of features selected by the feature selection model of the BWO-BOA in the 10% and 20% datasets is the same as that of the BWO, and only one difference from the BWO algorithm in the 5% and 30% datasets, the average number of selected features is also similar to the IBOA, but they are largely lower than the average number of features selected by other algorithms, including the BOA, which proves that the feature model of the BWO-BOA is effective for reducing the number of features selected by the feature model of the original BOA. This indicates that the model in this paper has a certain role in decreasing the redundancy of features and reducing dimensionality.
For the sake of judging the convergence speed and accuracy of the BWO-BOA in the binary classification, Figure 5 shows the fitness changes of different algorithms in the 50 iterations of the four datasets. It can be seen in Figure 5 that the fitness of the BWO-BOA is not high in the first-generation iteration process on the 20% and 30% datasets, which indicates that the BWO-BOA has a strong search ability from the beginning. In the four datasets, the fitness of the BWO-BOA is lower than the other algorithms, and it is the largest difference from the original BOA, which shows that the BOA combined with the movement strategy of BWO can reduce feature redundancy, while ensuring high classification accuracy. It proves that the BWO-BOA can well integrate the characteristics of the BOA and BWO and play a good role in binary classification.

5.3.2. Comparative Analysis of Multi-classification Results

Table 9, Table 10, Table 11 and Table 12 are the multi-classification results of the seven algorithms for the four datasets of 5%, 10%, 20% and 30%, respectively, which includes the A c c , P r e , R e c and F 1 results for the nine types of attacks. Overall, except for BWO and IBOA algorithms, the average number of features selected by the BWO-BOA is lower than that selected by other algorithms; especially compared with the original BOA, the redundancy of features is reduced to a great extent. Although it is not much different from the average number of features selected by BWO, the average classification accuracy of the BWO-BOA in the feature selection model is higher than all algorithms. From the identification of each attack category, perhaps because the number of attacks in the dataset is too small, the ‘Analysis’ attack is the most difficult type to identify, and the average classification accuracy of the seven algorithms in the four datasets is 0.
As shown in Table 9, the BWO-BOA, BOA, BWO and IBOA algorithms failed to identify the ‘Backdoor’ attack, but compared with the original BOA and the improved IBOA, the average classification precision of the improved BWO-BOA for the remaining seven attacks is improved. In addition, compared with BWO, the classification precision of ‘Exploits’, ‘Generic’ and ‘Worms’ attacks are greatly improved. As shown in Table 10, due to the increase in the number of datasets, the BWO-BOA can identify ‘Backdoor’ attack, while BWO and the IBOA fails to identify ‘Backdoor’ attack. The average precision of the BWO-BOA in ‘Fuzzers’, ‘Generic’ and ‘Worms’ attacks is also the highest among the seven algorithms; compared with the BOA, the average classification precision of the other attacks except the ‘Backdoor’ attack has been greatly improved. The average classification precision of each attack type is higher than that of the IBOA. As shown in Table 11, although the precision of the BWO-BOA in each attack category is not the highest, compared with the original BOA and BWO, the classification effect of each attack is greatly improved. Except for the ‘Backdoor’ and ‘Worms’ attacks, the average classification precision is higher than that of the IBOA. As shown in Table 12, for the hard-to-recognize ‘Backdoor’ attacks, the recognition effect of the BWO-BOA is higher than other algorithms; the recognition effect of ‘DoS’, ‘Exploits’, ‘Fuzzers’, ‘Reconnaissance’ and ‘Worms’ attacks are also better than other algorithms, and the classification effect of the BWO-BOA on the attack is much higher than the BOA, BWO and the improved IBOA algorithms.
In summary, the BWO-BOA in this paper has some advantages over the other six algorithms in multi-classification of feature selection models; especially compared with the original BOA, BWO and the improved IBOA algorithm, the classification of each attack is greatly improved, the validity of the proposed model is verified.
For the purpose of observing the effect of the proposed model more directly, Figure 6a shows the average classification accuracy of the seven algorithms for multi-classification on four datasets. Through the analysis of Figure 6a, this shows that the accuracy of the BWO-BOA is higher than other algorithms, which can prove that the BWO-BOA has some advantages in the feature selection model. Figure 6b shows the average number of features selected by the seven algorithms for multi-classification in the four datasets. It can be seen in Figure 6b that in the feature selection model of the seven algorithms, except BWO and IBOA algorithms, the BWO-BOA algorithm has the lowest average number of features selected; especially in the 5% dataset, the minimum average number of features is 8, which is 16 fewer than the original BOA, and 20 fewer relative to the SSA of the largest number for the seven algorithms. Furthermore, it is a small difference from the average number of features selected by the BWO and IBOA algorithms. This shows that the proposed model is effective in both the average classification accuracy and the average number of selected features, which verifies the effectiveness of the proposed model.
To observe the convergence of the BWO-BOA in multi-classification, Figure 7 shows the changes of the fitness of the algorithms during 50 iterations in the four datasets.
It can be seen in Figure 7 that the BWO-BOA algorithm has the greatest number of fitness changes in the iterative process, which proves that the BWO-BOA algorithm has a strong global search ability and does not easily fall into the local optimum. The BWO-BOA algorithm has the lowest fitness among the seven algorithms in the four datasets, which shows that, compared with the other six algorithms, the BWO-BOA algorithm not only has higher classification accuracy in multi-classification, but it can also reduce the redundancy of features based on guaranteeing the important features.

6. Conclusions

In order to improve the classification accuracy and reduce the redundancy of feature selection in intrusion detection models, this paper proposes an improved BOA combined with the BWO algorithm, namely, the BWO-BOA algorithm, which utilizes the dynamic adaptive search strategy and movement search strategy of BWO and the small differential mutation search strategy to improve the original BOA to solve the problems of low precision, slow convergence and easily falling into the local optimum. This paper uses the BWO-BOA algorithm to find the optimal feature subset and proposes a feature selection model based on the BWO-BOA algorithm for network intrusion detection. Experiments on the UNSW-NB15 dataset show that, compared to the BOA, BWO, PSO, SSA, WOA and IBOA algorithms, the proposed model can not only obtain a better feature subset, but also obtain a higher classification accuracy, which proves that the proposed model based on the BWO-BOA algorithm can effectively alleviate the problems of low classification accuracy and redundancy of feature selection in intrusion detection for network security.

Author Contributions

Conceptualization, H.X.; methodology, H.X. and Y.L.; software, Y.L. and Q.G.; validation, H.X., Y.L.; formal analysis, H.X.; investigation, Y.L. and Q.G.; resources, Y.L. and Q.G.; data curation, Y.L. and Q.G.; writing—original draft preparation, Y.L.; writing—review and editing, Y.L. and H.X.; supervision, H.X.; project administration, H.X.; funding acquisition, H.X. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the National Natural Science Foundation of China (No. 61602162).

Data Availability Statement

The dataset is available at: https://research.unsw.edu.au/projects/unsw-nb15-dataset, accessed on 16 September 2022.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Zhou, Y.; Cheng, G.; Jiang, S.; Dai, M. Building an efficient intrusion detection system based on feature selection and ensemble classifier. Comput. Netw. 2020, 174, 107247. [Google Scholar] [CrossRef] [Green Version]
  2. Deng, M.; Wang, K.; Zhang, C.; Zhang, Y. A comparative study of network intrusion detection evaluation data sets. Mod. Comput. 2020, 20, 20–26. [Google Scholar]
  3. Alazzam, H.; Sharieh, A.; Sabri, K.E. A feature selection algorithm for intrusion detection system based on pigeon inspired optimizer. Expert Syst. Appl. 2020, 148, 0957–4174. [Google Scholar] [CrossRef]
  4. Alshamy, R.; Ghurab, M. A review of big data in network intrusion detection system: Challenges, approaches, datasets, and tools. Int. J. Comput. Sci. Eng. 2020, 8, 62–74. [Google Scholar]
  5. Zarei, M.; Rezai, A.; Hamidpour, S.S.F. Breast cancer segmentation based on modified gaussian mean shift algorithm for infrared thermal images. Comput. Methods Biomech. Biomed. Eng. Imaging Vis. 2021, 9, 574–580. [Google Scholar] [CrossRef]
  6. Darabi, N.; Rezai, A.; Hamidpour, S.S.F. Breast cancer detection using RSFS-based feature selection algorithms in thermal images. Biomed. Eng. Appl. Basis Commun. 2021, 33, 2150020. [Google Scholar] [CrossRef]
  7. Salimian, M.; Rezai, A.; Hamidpour, S.; Khajeh-Khalili, F. Effective features in thermal images for breast cancer detection. In Proceedings of the 2nd National Conference on New Technologies in Electrical and Computer Engineering, Isfahan, Iran, 6 February 2019; pp. 1–7. [Google Scholar]
  8. Li, Y.; Qin, J. Application of a feature-selection method based on improved genetic algorithm in coronary heart disease detection. J. Huaihua Univ. 2021, 40, 57–62. [Google Scholar]
  9. Shi, Q.; Pan, F.; Long, F.; Li, N.; Gou, H.; Su, H.; Xie, Y. Summary of research on feature selection methods. Microelectron. Comput. 2022, 39, 1–8. [Google Scholar]
  10. Liang, B. A Review of the Application of swarm intelligence in network intrusion’s feature selection. Comput. Knowl. Technol. 2020, 16, 30–32. [Google Scholar]
  11. Tawil, A.A.; Sabri, K.E. A feature selection algorithm for intrusion detection system based on moth flame optimization. In Proceedings of the 2021 International Conference on Information Technology (ICIT), Amman, Jordanm, 14–15 July 2021; pp. 377–381. [Google Scholar]
  12. Chen, T.; Dong, H. Industrial anomaly intrusion detection using ant colony algorithm and deep reinforcement learning. J. Chin. Comput. Syst. 2022, 43, 779–784. [Google Scholar]
  13. Syarif, I.; Afandi, R.F.; Saputra, F.A. Feature selection algorithm for intrusion detection using cuckoo search algorithm. In Proceedings of the 2020 International Electronics Symposium (IES), Surabaya, Indonesia, 29–30 September 2020; pp. 430–435. [Google Scholar]
  14. Mahboob, A.S.; Moghaddam, M.R.O. An anomaly-based intrusion detection system using butterfly optimization algorithm. In Proceedings of the 2020 6th Iranian Conference on Signal Processing and Intelligent Systems (ICSPIS), Mashhad, Iran, 23–24 December 2020; pp. 1–6. [Google Scholar]
  15. Tubishat, M.; Alswaitti, M.; Mirjalili, S.; Al-Garadi, M.A.; Rana, T.A. Dynamic butterfly optimization algorithm for feature selection. IEEE Access 2020, 8, 194303–194314. [Google Scholar] [CrossRef]
  16. Selvakumar, B.; Muneeswaran, K. Firefly algorithm based feature selection for network intrusion detection. Comput. Secur. 2019, 81, 148–155. [Google Scholar]
  17. Saheed, Y.K. A Binary Firefly Algorithm Based Feature Selection Method on High Dimensional Intrusion Detection Data; Springer: Cham, Switzerland, 2022; Volume 109, pp. 273–288. [Google Scholar]
  18. Almomani, O. A feature selection model for network intrusion detection system based on PSO, GWO, FFA and GA algorithms. Symmetry 2020, 12, 1046. [Google Scholar] [CrossRef]
  19. Al-Yaseen, W.L. Improving intrusion detection system by developing feature selection model based on firefly algorithm and support vector machine. Int. J. Comput. Sci. 2019, 46, 534–540. [Google Scholar]
  20. Li, X.; Yi, P.; Wei, W.; Tian, L. LNNLS-KH: A feature selection method for network intrusion detection. Secur. Commun. Netw. 2021, 3, 1–22. [Google Scholar] [CrossRef]
  21. Chen, H.; Ma, X.; Huang, S. A feature selection method for intrusion detection based on parallel sparrow search algorithm. In Proceedings of the 2021 16th International Conference on Computer Science & Education (ICCSE), Lancaster, UK, 17–21 August 2021; pp. 685–690. [Google Scholar]
  22. Yang, J.; Ye, Z.; Yan, L.; Wang, R. Modified naive bayes algorithm for network intrusion detection based on artificial bee colony algorithm. In Proceedings of the 2018 IEEE 4th International Symposium on Wireless Systems within the International Conferences on Intelligent Data Acquisition and Advanced Computing Systems (IDAACS-SWS) IEEE, Lviv, Ukraine, 20–21 September 2018; pp. 35–40. [Google Scholar]
  23. Alsaleh, A.; Binsaeedan, W. The influence of salp swarm algorithm-based feature selection on network anomaly intrusion detection. IEEE Access 2021, 9, 112466–112477. [Google Scholar] [CrossRef]
  24. Alzaqebah, A.; Aljarah, I.; Al-Kadi, O.; Damaševičius, R. A modified grey wolf optimization algorithm for an intrusion detection system. Mathematics 2022, 10, 999. [Google Scholar] [CrossRef]
  25. Xu, H.; Przystupa, K.; Fang, C.; Marciniak, A.; Kochan, O.; Beshley, M. A combination strategy of feature selection based on an integrated optimization algorithm and weighted k-nearest neighbor to improve the performance of network intrusion detection. Electronics 2020, 9, 1206. [Google Scholar]
  26. Li, J.; An, Q.; Lei, H.; Deng, Q.; Wang, G.-G. Survey of lévy flight-based metaheuristics for optimization. Mathematics 2022, 10, 2785. [Google Scholar] [CrossRef]
  27. Zhang, X.; Tan, H. Butterfly optimization algorithm with dynamic variance gaussian mutation. J. Yunnan Norm. Univ. (Nat. Sci. Ed.) 2022, 42, 31–36. [Google Scholar]
  28. Xu, H.; Lu, Y.; Ye, Z. Applying cooperative search strategies to improve butterfly optimization algorithm. In Proceedings of the 2022 IEEE 25th International Conference on Computer Supported Cooperative Work in Design (CSCWD), Hangzhou, China, 4–6 May 2022. [Google Scholar]
  29. Mojtahedi, A.; Sorouri, F.; Souha, A.N.; Molazadeh, A.; Mehr, S.S. Feature selection-based intrusion detection system using genetic whale optimization algorithm and sample-based classification. arXiv 2022, arXiv:2201.00584. [Google Scholar]
  30. Yuan, Q.; Lu, L. Network intrusion detection method based on combination of improved ant colony optimization and genetic algorithm. J. Chongqing Univ. Posts Telecommun. (Nat. Sci. Ed.) 2017, 29, 84–89. [Google Scholar]
  31. Xu, H.; Fu, Y.; Liu, X.; Fang, C.; Su, J. Applying improved grey wolf optimizer algorithm integrated with cuckoo search to feature selection for network intrusion detection. Adv. Eng. Sci. 2018, 50, 160–166. [Google Scholar]
  32. Kang, Y.; Wang, H.; Tao, L.; Yang, H.; Yang, X.; Wang, F.; Li, H. Hybrid improved flower pollination algorithm and gray wolf algorithm for feature selection. Comput. Sci. 2022, 49, 125–132. [Google Scholar]
  33. Arora, S.; Singh, S. Butterfly optimization algorithm: A novel approach for global optimization. Soft Comput. 2019, 23, 715–734. [Google Scholar] [CrossRef]
  34. Peña-Delgado, A.F.; Peraza-Vázquez, H.; Almazán-Covarrubias, J.H.; Cruz, N.T.; García-Vite, P.M.; Morales-Cepeda, A.B.; Ramirez-Arredondo, J.M. A novel bio-inspired algorithm applied to selective harmonic elimination in a three-phase eleven-level inverter. Math. Probl. Eng. 2020, 2020. [Google Scholar] [CrossRef]
  35. Chen, J.; He, Q. Improved butterfly optimization algorithm based on cosine similarity. J. Comput. Appl. 2021, 41, 2668–2677. [Google Scholar]
  36. Gao, W.; Liu, S.; Xiao, Z.; Yu, J. Butterfly optimization algorithm based on convergence factor and gold sinusoidal guidance mechanism. Comput. Eng. Des. 2020, 41, 3384–3389. [Google Scholar]
  37. Zheng, H.; Feng, W.; Zhou, Y. Butterfly optimization algorithm based on sine cosine algorithm. Guangxi Sci. 2021, 28, 152–159. [Google Scholar]
  38. Liu, J.; Ma, Y.; Li, Y. Improved butterfly algorithm for multi-dimensional complex function optimization problem. Acta Electron. Sin. 2021, 49, 1068–1076. [Google Scholar]
  39. Shao, L.; Han, R. Beetle antenna search flower pollination algorithm. Comput. Eng. Appl. 2018, 54, 188–194. [Google Scholar]
  40. Moustafa, N.; Slay, J. Proceedings of the UNSW-NB15: A Comprehensive Data Set for Network Intrusion Detection Systems (UNSW-NB15 Network DataSet), 2015 Military Communications and Information Systems Conference (MilCIS), Canberra, ACT, Australia, 10–12 November 2015; pp. 1–6.
  41. Moustafa, N.; Slay, J. The evaluation of network anomaly detection systems: Statistical analysis of the UNSW-NB15 data set and the comparison with the KDD99 data set. Inf. Syst. Secur. 2016, 25, 18–31. [Google Scholar] [CrossRef]
  42. Al-Daweri, M.S.; Ariffin, K.; Abdullah, S.; Senan, M. An analysis of the KDD99 and UNSW-NB15 datasets for the intrusion detection system. Symmetry 2020, 12, 1666. [Google Scholar] [CrossRef]
  43. Kennedy, J.; Eberhart, R. Particle swarm optimization. In Proceedings of the ICNN’95-International Conference on Neural Networks, Perth, WA, Australia, 27 November–1 December 1995; pp. 1942–1948. [Google Scholar]
  44. Mirjalili, S.; Gandomi, A.H.; Mirjalili, S.Z.; Saremi, S.; Faris, H.; Mirjalili, M.S. Salp swarm algorithm: A bio-inspired optimizer for engineering design problems. Adv. Eng. Softw. 2017, 114, 163–191. [Google Scholar] [CrossRef]
  45. Mirjalili, S.; Lewis, A. The Whale optimization algorithm. Adv. Eng. Softw. 2006, 95, 51–67. [Google Scholar]
  46. Ren, J.; Zhang, Y.; Zhang, B.; Li, S. Classification method of industrial internet intrusion detection based on feature selection. J. Comput. Res. Dev. 2022, 59, 12. [Google Scholar]
Figure 1. Flow chart of proposed BWO-BOA algorithm.
Figure 1. Flow chart of proposed BWO-BOA algorithm.
Electronics 11 03531 g001
Figure 2. Feature selection model based on BWO-BOA algorithm.
Figure 2. Feature selection model based on BWO-BOA algorithm.
Electronics 11 03531 g002
Figure 3. (a) The fitness of different strategies in binary classification; (b) The fitness of different strategies in multi-classification.
Figure 3. (a) The fitness of different strategies in binary classification; (b) The fitness of different strategies in multi-classification.
Electronics 11 03531 g003
Figure 4. (a) The average accuracy of the seven algorithms in binary classification; (b) The average number of features selection for seven algorithms in binary classification.
Figure 4. (a) The average accuracy of the seven algorithms in binary classification; (b) The average number of features selection for seven algorithms in binary classification.
Electronics 11 03531 g004
Figure 5. (a) Fitness curves of binary classification for each algorithm on 5% datasets; (b) Fitness curves of binary classification for each algorithm on 10% datasets; (c) Fitness curves of binary classification for each algorithm on 20% datasets; (d) Fitness curves of binary classification for each algorithm on 30% datasets.
Figure 5. (a) Fitness curves of binary classification for each algorithm on 5% datasets; (b) Fitness curves of binary classification for each algorithm on 10% datasets; (c) Fitness curves of binary classification for each algorithm on 20% datasets; (d) Fitness curves of binary classification for each algorithm on 30% datasets.
Electronics 11 03531 g005
Figure 6. (a) The average accuracy of the seven algorithms in multi-classification; (b) The average number of features selected for seven algorithms in multi-classification.
Figure 6. (a) The average accuracy of the seven algorithms in multi-classification; (b) The average number of features selected for seven algorithms in multi-classification.
Electronics 11 03531 g006
Figure 7. (a) Fitness curves of multi-classification for each algorithm on 5% datasets; (b) Fitness curves of multi-classification for each algorithm on 10% datasets; (c) Fitness curves of multi-classification for each algorithm on 20% datasets; (d) Fitness curves of multi-classification for each algorithm on 30% datasets.
Figure 7. (a) Fitness curves of multi-classification for each algorithm on 5% datasets; (b) Fitness curves of multi-classification for each algorithm on 10% datasets; (c) Fitness curves of multi-classification for each algorithm on 20% datasets; (d) Fitness curves of multi-classification for each algorithm on 30% datasets.
Electronics 11 03531 g007aElectronics 11 03531 g007b
Table 1. Parameter settings of seven algorithms.
Table 1. Parameter settings of seven algorithms.
AlgorithmParameter
BWO-BOA p   =   0.5 ,   p 1   =   0.1 ,   p 2 = 0.3
BOA p =   0.8 , a =   0.1 , c = 0.01
BWO m =   0.4 0.9 , β =   1 1
PSO W   =   0.9 ,   c 1 = c2 = 3
SSA r 1 ,   r 2 ,   r 3 =   0 1
WOA b =   1 , C =   0 2 , l =   1 1
IBOA p max   =   0.8 ,   p min   =   0.3 , a   =   0.1 , c   =   0.01 ,   σ max =   1.5 ,   σ min   =   0.4 ,   p g = 0.5
Table 2. Feature classification table.
Table 2. Feature classification table.
TypeFeature
Objectproto, service, state, attack_cat
Integerspkts, dpkts, sbytes, dbytes, sttl, dttl, sload, dload, swin, stcpb, dtcpb, dwin, smean, dmean, trans_depth, response_body_len, ct_srv_src, ct_state_ttl, ct_src_dport_ltm, ct_dst_ltm, ct_ftp_cmd, ct_flw_http_mthd, ct_src_ltm, ct_dst_sport_ltm, ct_dst_src_ltm, ct_srv_dst
Floatdur, rate, sloss, dloss, sinpkt, dinpkt, sjit, djit, tcprtt, synack, ackdat
Binaryis_sm_ips_ports, is_ftp_login, label
Table 3. Binary classification results with different improvement strategies.
Table 3. Binary classification results with different improvement strategies.
Algorithm A c c ( % ) P r e ( % ) R e c ( % ) F 1 ( % ) n
BWO-BOA96.2897.1593.5795.158
BOA94.4995.6990.5692.6824
BOA194.3795.7490.2292.5023
BOA296.2396.9093.6795.1023
Table 4. Multi-classification results for different strategies.
Table 4. Multi-classification results for different strategies.
AlgorithmIndicatorAnalysisBackdoorDoSExploitsFuzzersGenericNormalReconnaissanceWorms
BWO-BOA P r e (%)05.0032.4076.3444.7699.8897.1345.4010.71
R e c (%)010.0018.3091.1463.2598.3388.2738.1310.71
F 1 (%)06.6622.6683.0451.8699.1092.4539.949.52
A c c (%)91.20
n 8
BOA P r e (%)0022.9067.8135.3699.7396.9046.052.22
R e c (%)0012.9889.5146.5998.0480.2632.266.66
F 1 (%)0015.6976.9839.2098.8887.7335.743.33
A c c (%)88.21
n 23
BOA1 P r e (%)0029.0367.9135.8899.7897.4836.354.44
R e c (%)0013.6790.7351.3998.1379.4428.306.66
F 1 (%)0017.4177.5541.4498.9487.4729.335.33
A c c (%)88.26
n 28
BOA2 P r e (%)05.5532.1875.3644.5299.8397.3647.519.33
R e c (%)011.1117.6291.1662.7798.2587.1441.6210.00
F 1 (%)07.4021.9682.4651.4699.0391.9442.568.84
A c c (%)91.01
n 28
Table 5. Binary classification results of seven algorithms in 5% of the dataset.
Table 5. Binary classification results of seven algorithms in 5% of the dataset.
Algorithm A c c ( % ) P r e ( % ) R e c ( % ) F 1 ( % ) n
BWO-BOA96.1496.8893.4994.988
BOA94.4395.6490.1492.4124
BWO96.1096.7193.5294.947
PSO96.0896.7693.2494.7920
SSA94.5895.7290.4692.6626
WOA95.1196.0991.4393.4116
IBOA94.7295.4591.3693.086
Table 6. Binary classification results of seven algorithms in 10% of the dataset.
Table 6. Binary classification results of seven algorithms in 10% of the dataset.
Algorithm A c c ( % ) P r e ( % ) R e c ( % ) F 1 ( % ) n
BWO-BOA95.9396.8592.9694.667
BOA94.4495.7590.3092.5724
BWO95.9096.7692.9694.647
PSO95.8496.6692.8894.5423
SSA94.7195.8690.8792.9627
WOA94.9595.8891.4493.3221
IBOA95.2796.0692.1293.806
Table 7. Binary classification results of seven algorithms in 20% of the dataset.
Table 7. Binary classification results of seven algorithms in 20% of the dataset.
Algorithm A c c ( % ) P r e ( % ) R e c ( % ) F 1 ( % ) n
BWO-BOA95.9296.6693.0994.667
BOA94.5595.7890.6192.7524
BWO95.8496.5593.0194.577
PSO95.9196.5193.2394.6822
SSA95.3496.2292.1093.8827
WOA95.3996.1992.2593.9619
IBOA94.9595.9491.4193.317
Table 8. Binary classification results of seven algorithms in 30% of the dataset.
Table 8. Binary classification results of seven algorithms in 30% of the dataset.
Algorithm A c c ( % ) P r e ( % ) R e c ( % ) F 1 ( % ) n
BWO-BOA95.9596.6493.1594.698
BOA94.7195.8890.8692.9725
BWO95.7796.4092.9294.467
PSO95.8196.6892.8094.5021
SSA95.1296.2891.5193.5527
WOA95.2596.3191.7993.7413
IBOA94.6295.6690.8692.896
Table 9. Multi-classification results of seven algorithms in 5% of the dataset.
Table 9. Multi-classification results of seven algorithms in 5% of the dataset.
AlgorithmIndicatorAnalysisBackdoorDoSExploitsFuzzersGenericNormalReconnaissanceWorms
BWO-BOA P r e (%)0027.6474.7946.5099.8497.8943.2323.14
R e c (%)0017.6791.2961.2298.3387.5942.2622.22
F 1 (%)0020.9982.1251.6199.0792.4141.2622.03
A c c (%)91.28
n8
BOA P r e (%)0023.5166.2340.3899.7297.1634.2712.50
R e c (%)0014.9490.0450.6398.1978.7627.8020.83
F 1 (%)0017.2376.1343.3198.9586.8828.6415.55
A c c (%)88.20
n 24
BWO P r e (%)0030.6373.4947.1099.7197.4844.418.33
R e c (%)0013.5490.8666.3298.0885.4241.894.62
F 1 (%)0017.8981.1954.4298.8990.9941.485.55
A c c (%)90.30
n 7
PSO P r e (%)012.5029.6675.0845.1599.8097.5546.6621.05
R e c (%)010.0021.2291.0962.4898.3485.5939.4017.10
F 1 (%)010.0024.2582.2351.6399.0791.1141.5417.89
A c c (%)90.76
n 23
SSA P r e (%)01.9229.8165.1742.3095.8097.7638.0316.66
R e c (%)03.8416.6281.2162.7094.7778.6531.3811.11
F 1 (%)02.5620.5070.5549.7995.2287.1132.7212.96
A c c (%)88.36
n 28
WOA P r e (%)03.1229.5769.9551.0591.4991.6840.4822.64
R e c (%)06.2522.8289.4062.1589.1979.4633.3123.52
F 1 (%)04.1624.9277.9454.5089.9984.8235.0522.54
A c c (%)89.33
n 17
IBOA P r e (%)0025.0568.6837.7499.7496.2631.001.42
R e c (%)0012.1791.2446.9998.0382.6820.103.57
F 1 (%)0015.6178.2139.2998.8888.8521.992.04
A c c (%)89.23
n 6
Table 10. Multi-classification results of seven algorithms in 10% of the dataset.
Table 10. Multi-classification results of seven algorithms in 10% of the dataset.
AlgorithmIndicatorAnalysisBackdoorDoSExploitsFuzzersGenericNormalReconnaissanceWorms
BWO-BOA P r e (%)06.1432.0776.3946.7899.8497.7159.2435.96
R e c (%)07.8919.1991.5265.7498.4386.7050.3632.42
F 1 (%)06.8423.4983.2454.0099.1391.8553.0831.85
A c c (%)91.35
n 9
BOA P r e (%)08.3319.7268.2739.8397.2595.0533.0318.13
(%)05.5512.4288.7153.3795.9179.0124.629.21
F 1 (%)06.4814.2076.8945.0096.5786.1927.4311.84
A c c (%)88.47
n 23
BWO P r e (%)0035.5075.9344.2599.8297.1349.1128.38
R e c (%)0020.2291.0358.8998.3786.4643.5618.09
F 1 (%)0025.4482.7647.2399.0991.4343.6721.57
A c c (%)90.95
n 7
PSO P r e (%)015.7435.4876.4845.8699.8397.9252.0627.31
R e c (%)012.9623.2991.5164.7698.4585.7242.5212.18
F 1 (%)013.7027.5383.2853.3899.1391.3845.9715.67
A c c (%)91.03
n 23
SSA P r e (%)09.7229.1869.9240.3999.8297.4541.8115.88
R e c (%)08.3315.3390.2560.1098.3080.7833.149.36
F 1 (%)08.3319.5278.6847.9199.0588.2735.8811.03
A c c (%)88.93
n 25
WOA P r e (%)05.2028.7872.1038.4999.7597.4240.7319.44
R e c (%)05.2015.7990.0355.1598.3484.0933.2211.62
(%)05.2019.1579.9944.6299.0490.1635.9913.24
A c c (%)89.87
n 15
IBOA P r e (%)0021.4069.1237.0999.7097.1127.8613.85
R e c (%)0011.0291.3240.1698.2382.6022.8212.69
F 1 (%)0013.6778.4836.2798.9689.2322.4211.52
A c c (%)89.15
n 5
Table 11. Multi-classification results of seven algorithms in 20% of the dataset.
Table 11. Multi-classification results of seven algorithms in 20% of the dataset.
AlgorithmIndicatorAnalysisBackdoorDoSExploitsFuzzersGenericNormalReconnaissanceWorms
BWO-BOA P r e (%)08.4737.6475.5646.2399.8797.4948.6133.01
R e c (%)09.3321.7391.6566.2298.3786.2240.6229.94
F 1 (%)07.9326.7582.7754.0699.1191.4943.1430.16
A c c (%)91.10
n 9
BOA P r e (%)05.5526.7868.5041.5699.8297.7839.2523.33
R e c (%)02.6614.3090.1953.9298.0581.5730.378.33
F 1 (%)03.2117.7377.7445.8298.9388.9132.6711.43
A c c (%)88.68
n 24
BWO(%)08.3334.8575.5543.6099.8397.4840.4625.43
R e c (%)05.4120.6692.0162.6698.3786.0734.3826.80
F 1 (%)05.6125.4882.9351.3099.1091.4136.1524.63
A c c (%)90.89
n 7
PSO P r e (%)05.2538.8377.1146.8099.8697.4751.2837.43
R e c (%)012.5024.4791.2165.1198.3987.1242.6329.97
F 1 (%)07.3029.6683.5554.1399.1291.9845.7131.57
A c c (%)91.32
n 22
SSA P r e (%)09.7634.6972.2241.3299.7897.5246.1136.72
R e c (%)012.0819.0490.0258.8798.2283.7329.9820.94
F 1 (%)09.6624.0480.0148.2298.9990.0434.6425.22
A c c (%)89.78
n 26
WOA P r e (%)04.3033.7979.2141.3399.8096.2541.7430.31
R e c (%)05.4117.2990.1956.5698.2185.5136.0021.24
F 1 (%)04.1621.6880.5446.5799.0090.4037.7622.84
A c c (%)90.14
n 16
IBOA P r e (%)010.8324.9370.2540.2199.7397.0431.4645.11
R e c (%)015.4115.9691.0953.0998.3082.6325.6823.75
F 1 (%)012.2019.2079.2445.1099.0189.2327.2627.56
A c c (%)89.45
n 5
Table 12. Multi-classification results of seven algorithms in 30% of the dataset.
Table 12. Multi-classification results of seven algorithms in 30% of the dataset.
AlgorithmIndicatorAnalysisBackdoorDoSExploitsFuzzersGenericNormalReconnaissanceWorms
BWO-BOA P r e (%)08.3340.2277.6946.9399.8597.5552.0647.28
R e c (%)013.4225.5891.1369.0398.6185.7945.1840.10
F 1 (%)09.7930.6283.8655.6699.2391.2847.5942.41
A c c (%)91.42
n 10
BOA P r e (%)02.5028.5169.0538.4799.8197.9735.7521.68
R e c (%)03.7516.4290.6156.3398.0579.0526.2111.81
F 1 (%)02.9120.2478.2445.4298.9287.4329.7514.12
A c c (%)88.67
n 23
BWO P r e (%)03.0835.0875.6045.7999.8496.7439.6634.31
R e c (%)04.1621.2291.5660.9498.4086.7034.8327.26
F 1 (%)03.4725.7782.7351.6699.1291.3835.6228.11
A c c (%)91.08
n 7
PSO P r e (%)07.3438.2977.6045.7999.8697.9048.8842.84
R e c (%)018.4125.4390.7462.0098.5485.7644.1631.57
F 1 (%)09.8530.3183.6152.2099.2091.4245.7934.51
A c c (%)91.09
n 22
SSA P r e (%)04.5527.8072.1240.8599.8496.8639.9335.19
R e c (%)03.9118.3089.5457.7998.4382.0532.2914.85
F 1 (%)03.5421.7879.8247.3599.1388.7835.2618.47
A c c (%)89.34
n 26
WOA P r e (%)03.6231.1773.3941.4399.8097.2844.3237.10
R e c (%)07.0018.7590.8761.3498.4082.2633.7723.84
F 1 (%)04.0523.1781.1149.3599.0989.0936.0826.73
A c c (%)89.65
n 16
IBOA P r e (%)03.4826.7071.5138.8299.7095.8137.6830.88
R e c (%)07.0813.6188.9553.5598.3183.5133.1924.90
F 1 (%)04.1717.1079.1644.2799.0089.0734.3326.06
A c c (%)89.44
n 5
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Xu, H.; Lu, Y.; Guo, Q. Application of Improved Butterfly Optimization Algorithm Combined with Black Widow Optimization in Feature Selection of Network Intrusion Detection. Electronics 2022, 11, 3531. https://doi.org/10.3390/electronics11213531

AMA Style

Xu H, Lu Y, Guo Q. Application of Improved Butterfly Optimization Algorithm Combined with Black Widow Optimization in Feature Selection of Network Intrusion Detection. Electronics. 2022; 11(21):3531. https://doi.org/10.3390/electronics11213531

Chicago/Turabian Style

Xu, Hui, Yanping Lu, and Qingqing Guo. 2022. "Application of Improved Butterfly Optimization Algorithm Combined with Black Widow Optimization in Feature Selection of Network Intrusion Detection" Electronics 11, no. 21: 3531. https://doi.org/10.3390/electronics11213531

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