# An Efficient NIDPS with Improved Salp Swarm Feature Optimization Method
## 3 Materials and Methods
### Feature Selection Using Improved Salp Swarm Algorithm (ISSA) Method  
In the feature selection phase, previously many of the studies used wrapper and filter methods. Those are old and manual methods based on scores and rankings of features. Therefore, the proposed study uses an automated way of feature selection via an evolutionary computing domain method. Evolutionary computing domain methods are nature-inspired and have heuristic ways to find an optimal way to fulfill their goals. These methods are considered to be more optimal due to their heuristic and searching potential nature. It does not use any fixed  
Figure 1: Flowchart of the proposed methodology to detect binary and multiclass network attacks. threshold value to filter out any particular data whereas it uses a fitness function to calculate and iterate over the whole feature space of given data. It uses multiple iterations and uses all feature combinations throughout the input feature space. Therefore, it is considered a more optimal solution as compared to other manual feature selection methods. For example, sea species search around for food and have almost the same searching criteria. Similarly, salp is a marine organism that has a shape very similar to jellyfish. It moves and feeds through its feeding filters. It has a salp chain-like structure. While finding food, its leader's salp individual leads the chain and tries to find the optimal location to find food. Once a more optimal location is found, it updates the whole salp chain after updating the leader location into search space. The original method of SSA was developed in 2017 by [PERSON] et al. [41]. In that method, a search space is given in which a weight initialization is given to the salp population. The weights continuously remain updated using lower and upper bound values concerning the best position found by salp individuals. However, the improved version for salp swarm optimization was published in 2020 by [PERSON] et al. [42]. This method uses KNN classifiers while calculating the fitness of each iteration and considers new ones on two bases: the minimization of features and the maximization of accuracy with the selected subset of features. The pseudo-steps for feature selection using the ISSA method are given in Algorithm 1:  
```
Step 1: Initialize and load preprocessed dataset Step 2: Initialize all salp (indices) locations with random values Step 3: Dedicate different feature subsets to all salps Step 4: Check the fitness of all salps using the ISSA fitness function Step 5: Update the positions of all salps Step 6: if maximum iteration is reached or stopping condition is reached, stop and extract the maximum accuracy achieved feature subset using the KNN method or if not then revise steps 1 to 5
```  
**Algorithm 1** ISSA method working steps. The major steps of the ISSA feature selection method are described above that contain 6 steps mainly. As we can see in step 2, the locations of salps are initialized using random values, and its mathematical representation is shown in Equation (2). \[D_{n}^{1}= \begin{cases}w*Pos_{n}+r_{1}((up_{n}-low_{n})r_{2}+low_{n})&\text{if }r_{ 3}>=0\\ w*Pos_{n}-r_{1}((up_{n}-low_{n})r_{2}+low_{n})&\text{if }r_{3}<0\end{cases}  \tag{2}\]  
In Equation (2), \(D_{n}^{1}\), representing the leader position of the salp chain, used an inertia parameter \(w\), which has [0,1] range of values where \(Pos_{n}\) is the \(nth\) position of the food source. The \(r_{1}\) is a random value that also ranges between 0,1. It balances the exploitation fact if any are found in locating the new position of the salp leader. The \((up_{n})\) and \((low_{n})\) are showing the upper and lower bound positions of search space in a given matrix of feature column values. However, after setting the leader position in the salp chain, the followers' positions are updated using Equation (3).