1. Introduction
With the rapid advancement of Internet technologies and the widespread proliferation of network applications, cybersecurity threats have become increasingly severe. Various forms of network attacks continue to evolve and escalate, imposing significant economic losses and privacy risks on enterprises, governments, and individual users. As a core component of network security defense, the intrusion detection system (IDS) [
1] is considered essential for real-time network traffic monitoring, anomaly identification, and alert generation, serving as a critical technical measure against network intrusions [
2]. However, modern network traffic data typically exhibit high dimensionality and substantial redundancy. The presence of numerous irrelevant or redundant features not only significantly increases the computational overhead of model training but also degrades classifier performance [
3,
4]. Consequently, efficiently identifying the most discriminative feature subset from a large pool of raw features has emerged as a key challenge in enhancing the effectiveness of intrusion detection systems [
5].
Feature selection (FS) [
6] is defined as the process of identifying and retaining the most informative features from a high-dimensional feature space that contribute most to classification tasks. By reducing feature dimensionality and minimizing noise interference, FS improves model generalization capability and training efficiency. Feature selection methods are typically classified into three categories: filter-based, wrapper-based, and embedded methods [
7]. Among these, wrapper-based methods directly employ classifier performance as the evaluation criterion for feature subsets, yielding feature combinations that are highly aligned with specific classification tasks. However, since the search space grows exponentially with the number of features, wrapper-based feature selection is inherently an NP-hard problem, making it infeasible for traditional exhaustive search or greedy algorithms to obtain high-quality solutions within a reasonable time frame. To address this challenge, metaheuristic optimization algorithms have been widely introduced for feature selection. Inspired by biological collective behaviors or physical phenomena observed in nature, these algorithms are characterized by simple heuristic mechanisms and strong global exploration capabilities, making them broadly applicable across various domains [
8]. Representative examples include the particle swarm optimization (PSO) [
9], whale optimization algorithm (WOA) [
10], harris hawks optimization (HHO) [
11], sparrow search algorithm (SSA) [
12], and grey wolf optimizer (GWO) [
13].
GWO is a metaheuristic optimization algorithm that simulates the social hierarchy and cooperative hunting behavior of grey wolf packs in nature [
13]. Owing to its simple structure, minimal parameterization, and fast convergence speed, GWO has been widely applied in the field of feature selection [
14,
15]. To further enhance its performance, a series of improved strategies have been proposed from different perspectives. These include a dimensional learning mechanism to enhance global exploration capability [
16], a random-walk-based position update strategy to improve local exploitation performance [
17], and fuzzy logic-based parameter control for adaptive adjustment of the convergence factor [
18]. Furthermore, a competitive binary variant has been developed to accelerate the solution of binary optimization problems [
14]. However, these methods still suffer from fixed leader wolf weight allocation, which fails to respond to the dynamic changes in individual search states and population evolution stages, thereby limiting the optimization capability of the algorithm.
To overcome these limitations, a Deep Reinforcement Learning-based grey wolf optimizer (DGWO) is proposed in this paper. The proposed method constructs a three-dimensional state representation that integrates individual fitness ranking, search stagnation degree, and population diversity, enabling the agent to simultaneously perceive both the local search state of individuals and the macroscopic evolutionary dynamics of the population. On this basis, the guidance weights of the leader wolves are dynamically adjusted throughout the iterative process. Accordingly, this study hypothesizes that dynamically regulating the guidance weights of the , , and wolves according to individual and population states can improve the optimization performance of GWO and enable the selection of more compact and discriminative feature subsets. This hypothesis is evaluated through comparative experiments, ablation studies, and convergence analysis. The primary contributions of this work are as follows:
A Deep Reinforcement Learning (DRL)-driven adaptive weight adjustment mechanism is proposed to enhance the GWO. Specifically, a Deep Q-Network is pre-trained offline to dynamically regulate the influence weights of the three leader wolves during the optimization process, thereby improving the search capability and convergence performance of the algorithm.
A three-dimensional state representation is designed to guide the decision-making process of the DRL agent. It jointly encodes individual fitness ranking, search stagnation degree, and population diversity, enabling the model to capture both local search behavior and global evolutionary dynamics.
The proposed DGWO is applied to intrusion detection feature selection, where a standard discretization strategy and a composite fitness function are adopted to evaluate candidate solutions.
Experiments on the NSL-KDD, UNSW-NB15, and CIC-IDS-2017 datasets against seven algorithms show that DGWO consistently achieves superior performance across all evaluation metrics, while requiring the fewest features on average, thereby validating its effectiveness for intrusion detection feature selection.
The subsequent sections are structured as follows:
Section 2 reviews related work.
Section 3 introduces the foundational techniques of GWO and DQN.
Section 4 presents the detailed design of the DGWO algorithm and its application to feature selection.
Section 5 discusses the experimental evaluation.
Section 6 summarizes the main findings of this study and discusses possible directions for future work.
2. Related Work
Feature selection aims to identify the most discriminative feature subset from a high-dimensional feature space, and is recognized as a critical component in enhancing the performance of intrusion detection systems. Existing feature selection methods are broadly categorized into three groups: filter-based, wrapper-based, and embedded methods [
19,
20].
Filter-based methods evaluate features independently of any classifier using statistical criteria such as information gain and correlation coefficients. While these approaches are computationally efficient, they tend to overlook feature interactions and classifier compatibility, which often results in suboptimal classification performance for the selected subset [
21].
Embedded methods integrate the feature selection process directly into model training, allowing them to account for both feature relevance and model performance simultaneously. However, their outcomes are tightly coupled to specific learning algorithms, which limits their generalizability across different tasks [
22].
In contrast, wrapper-based methods directly employ classifier performance as the evaluation criterion for candidate feature subsets, enabling the identification of feature combinations that are highly tailored to specific classification tasks. Nevertheless, since the search space grows exponentially with the number of features, wrapper-based feature selection is inherently an NP-hard problem, making traditional exhaustive and greedy strategies insufficient for obtaining high-quality solutions within a reasonable time frame [
20].
To address this challenge, metaheuristic optimization algorithms have been widely adopted as search strategies in wrapper-based feature selection, leveraging swarm intelligence mechanisms to efficiently explore optimal feature combinations in high-dimensional spaces [
23]. Kunhare et al. [
24] combined particle swarm optimization (PSO) with random forest-based feature pre-screening for wrapper-based optimization of intrusion detection feature subsets on the NSL-KDD dataset, achieving effective compression of the feature space while significantly improving detection accuracy and reducing false alarm rates. Alazzam et al. [
25] introduced a wrapper-based feature selection approach grounded in the pigeon-inspired optimizer (PIO), proposing two variants, SPIO and CPIO, that guide position updates via cosine similarity strategies. Their method demonstrated notable reductions in selected feature count alongside considerable gains in intrusion detection classification accuracy. Safaldin et al. [
26] developed GWOSVM-IDS, an intrusion detection framework combining an improved binary grey wolf optimizer with a support vector machine, which explores optimal feature subsets by adjusting the pack size and effectively reduces false alarm rates while enhancing detection accuracy on the NSL-KDD dataset. Alzaqebah et al. [
27] proposed a modified grey wolf optimizer (MGWO) that integrates filter-based and wrapper-based concepts, employing an intelligent initialization mechanism to preferentially retain information-rich features during the early stages of optimization, thereby improving the IDS capability for detecting anomalous network traffic. Kareem et al. [
28] designed GTO-BSA, a hybrid feature selection approach that fuses the gorilla troops optimizer (GTO) with the bird swarm algorithm (BSA). By leveraging the strong local exploitation capability of BSA to compensate for GTO’s limitations, this method achieves superior convergence speed and solution quality compared to multiple competing algorithms across four benchmark datasets, including NSL-KDD, CICIDS-2017, UNSW-NB15, and BoT-IoT. Sezgin et al. [
29] conducted a comparative analysis of multi-objective feature selection methods for intrusion detection systems using several representative metaheuristic algorithms, including GWO and PSO, demonstrating that different optimization strategies lead to significantly different trade-offs between detection accuracy and feature reduction. Mansouri and Hosseini [
30] proposed a chaos-enhanced hybrid metaheuristic feature selection method combined with an artificial neural network classifier for intrusion detection. Their approach integrates opposition-based learning for population initialization, a hybrid Gray Wolf Optimization–Whale Optimization Algorithm to balance exploration and exploitation, and a chaos-based local search strategy to improve convergence behavior and avoid local optima. Experimental results demonstrate that the proposed method can effectively reduce feature dimensionality while improving detection accuracy and robustness in complex network environments. Although these metaheuristic-based methods have improved intrusion detection feature selection to varying degrees, their search mechanisms are still largely governed by fixed parameters or manually designed strategies. Consequently, they cannot effectively adapt to changes in individual search states and population evolution, thereby limiting further improvements in optimization performance.
Reinforcement learning (RL) [
31] is a machine learning paradigm in which an agent learns optimal decision-making policies through continuous interaction with its environment. Its inherent capacity to extract knowledge from historical experience and enable dynamic parameter adjustment provides a promising avenue for overcoming the aforementioned limitations. In the domain of enhancing metaheuristic search mechanisms via reinforcement learning, Seyyedabbasi et al. [
32] proposed three Q-learning-based hybrid algorithms that separately integrate reinforcement learning with the whale optimization algorithm (RLWOA), the incremental grey wolf optimizer (RLI-GWO), and the extended grey wolf optimizer (RLEx-GWO). By employing a reward-punishment mechanism to enable the agent to adaptively switch between exploration and exploitation phases, the effectiveness of these hybrid strategies was validated on 30 benchmark functions and a robot inverse kinematics problem. Seyyedabbasi [
33] further combined Q-learning with the sand cat swarm optimization algorithm to develop RLSCSO, demonstrating the advantage of reinforcement learning in enhancing global optimization accuracy across 20 benchmark functions and a mobile sensor node localization problem. Ming et al. [
34] incorporated deep reinforcement learning into the operator selection process of a constrained multi-objective evolutionary algorithm, characterizing the state using the convergence, diversity, and feasibility of the population, and dynamically selecting the most appropriate evolutionary operator for the current search phase via DQN. This approach achieved superior performance over manually designed strategies on constrained multi-objective optimization benchmarks.
The above studies demonstrate that reinforcement learning can effectively improve the adaptability of metaheuristic algorithms. However, existing reinforcement learning-assisted methods mainly employ agents for global parameter adjustment, exploration–exploitation switching, or predefined operator selection, and therefore pay limited attention to the differentiated search states of individuals and the cooperative guidance of multiple leader solutions. In contrast, DGWO jointly considers individual states and population states, and uses DQN to dynamically adjust the guidance weights of the , , and wolves for each individual, thereby providing a more targeted adaptive search mechanism for GWO.
4. Proposed Method
In this section, the detailed design of the proposed enhanced heuristic optimization algorithm is presented, along with its application to feature selection in network intrusion detection systems.
4.1. Reinforcement Learning Design for DGWO
To enable GWO to dynamically and adaptively regulate the guidance weights of the leader wolves throughout the optimization process, the underlying decision-making problem is formulated as a MDP and addressed within a deep reinforcement learning framework. The MDP is characterized by three core components: the state space, the action space, and the reward function, each of which is elaborated in detail below.
4.1.1. State
The principled construction of the state space is a prerequisite for the agent to make effective decisions. To endow the agent with simultaneous local perception of individual search states and global awareness of the overall population dynamics, a three-dimensional state vector is designed as follows:
characterizes the relative quality of the
i-th grey wolf within the current population. At each generation, all individuals are first sorted from best to worst according to their fitness values, and the resulting ranks are then linearly normalized to the interval
:
where pop denotes the population size. A value of
approaching 0 indicates that the individual is among the top-performing members of the current population, whereas a value approaching 1 signals that its fitness is relatively poor and its position deviates substantially from the higher-quality region of the search space.
quantifies the degree to which an individual has been trapped in a stagnant search state over recent iterations. An adaptive window length
is introduced to handle the insufficient historical data available in the early stages of optimization. The stagnation metric is subsequently computed by using the fitness at the start of the window,
, as the normalization reference:
where
is the fitness value of the
i-th individual at generation
t, and
is a small constant introduced for numerical stability. A value of
approaching 1 indicates that the fitness improvement within the window is negligible and the individual has effectively stalled, whereas a value approaching 0 indicates that the individual is in a productive search state.
reflects the degree of spatial dispersion of the entire population across the search space, serving as a global indicator of the evolutionary phase in which the algorithm currently operates. Following the median-based dimensional diversity measure proposed by Hussain et al. [
5], the per-dimension dispersion is first computed and then averaged after normalization:
where
is the position of the
i-th individual along the
j-th dimension at generation
t,
and
are the upper and lower search bounds of dimension
j, respectively, and dim is the problem dimensionality. The normalization eliminates scale discrepancies arising from different search ranges across dimensions, ensuring
. A higher value signifies a dispersed population characteristic of the global exploration phase, while a lower value indicates population convergence and a transition into the local exploitation phase. This global feature complements the individual-level features, enabling the agent to integrate information from both levels and make more targeted weight adjustment decisions.
4.1.2. Action
As described above, the agent must dynamically regulate the influence weights of the three leader wolves in response to both the evolutionary phase of the population and the real-time search state of each individual. Within the hierarchical guidance mechanism of GWO, the
,
, and
wolves represent decreasing tiers of guidance quality. Amplifying the weight assigned to a particular leader wolf strengthens its dominant role in steering the position update of each individual. Specifically, increasing
concentrates the individual’s search around the current global best region, whereas increasing
or
promotes exploration of new directions and enhances population diversity, thereby facilitating escape from local optima. The weight configuration is subject to the equality constraint
. Based on these considerations, the action space is defined as a discrete set of four candidate actions:
where
,
, and
denote amplification of the guidance weight of the corresponding leader wolf, and Stay indicates that the current weight configuration is maintained without modification. The three amplification actions share a unified structural form. Let
denote the target leader wolf whose weight is to be increased, and let
j and
l denote the remaining two leader wolves (
). The weight update rules following action execution are then:
where
is the adjustment step size and
is the upper bound imposed on any individual weight. Equation (
22) increments the target weight by one step and clips the result at
, while Equations (23) and (24) proportionally reduce the remaining two weights while preserving their relative ratio. The Stay action applies no modification to any weight, i.e.,
for all
. The leader wolf influence weights for each individual are initialized to
, and are subsequently adjusted in an adaptive manner by the agent according to the real-time state of that individual.
4.1.3. Reward
The reward function serves as the central mechanism that guides the agent’s learning direction within the reinforcement learning framework [
36], and its formulation directly determines the quality of the policy acquired by the agent. With the minimization of the fitness function as the optimization objective, and adhering to the fundamental principle that a decrease in fitness corresponds to an improvement in solution quality, the following reward function is designed:
where
is the fitness function to be optimized, and
and
are the position vectors of the
i-th individual before and after the weight adjustment action is executed, respectively.
This reward design offers three distinct advantages. First, the reward signal is directly aligned with the optimization objective, requiring no auxiliary rewards or hand-crafted heuristic rules; the semantic interpretation of the reward is unambiguous, with no risk of goal misspecification. Second, the reward values are restricted to the discrete set , rendering them independent of the specific scale and units of the fitness function; this scale-invariant formulation enables the acquired decision policy to generalize effectively across optimization problems of different types. Third, the reward is returned immediately following each position update, allowing the agent to rapidly perceive the impact of weight direction adjustments on fitness improvement, which in turn accelerates the convergence of policy learning.
4.2. Training Procedure of the Decision Model
To equip the agent with an effective weight adjustment policy, a systematic training procedure centered on experience replay and a target network is designed, with policy generalizability further enhanced through a diverse collection of training functions.
The training process is organized in episodes, where each episode represents a complete optimization run. The benchmark functions used for training are drawn from the CEC2017 test suite [
37], which comprises unimodal, simple multimodal, hybrid, and composition functions. One function was selected from each major category of the CEC2017 test suite for training: F1 (Shifted and Rotated Bent Cigar Function) from the unimodal category, F5 (Shifted and Rotated Rastrigin’s Function) from the simple multimodal category, F11 (Hybrid Function 1,
) from the hybrid category, and F21 (Composition Function 1,
) from the composition category. This setting enables the DQN agent to learn weight adjustment strategies under different search landscapes. We use these functions for training due to their stable and low-cost optimization environment, which avoids noisy reward signals and high computational overhead in intrusion detection datasets.
The offline DQN model was trained for 300 episodes. The four selected functions were used in a cyclic manner during training. Specifically, in each episode, one of the four functions was selected in turn, and one complete DGWO optimization run was performed on the selected function. In each episode, the maximum number of iterations was set to 200, and the population size was set to 30.
During the execution of a single episode, the agent observes the three-dimensional state vector
of each individual and selects an action using an
-greedy strategy. The exploration rate
was linearly annealed from 0.9 to 0.01 over the first 200 episodes and was subsequently maintained at 0.01 for the remaining 100 episodes. This annealing schedule encouraged the agent to perform more exploratory actions in the early training stage and gradually rely more on the learned Q-value policy in the later stage. The resulting transition tuple
is stored in the experience replay buffer. Batches are randomly sampled to update network parameters, breaking temporal correlations and improving training stability. Training targets are constructed from the Bellman optimality equation using the target network, and parameters are updated by minimizing the mean squared error loss defined in Equation (
26). After training, the online network parameters are saved as
for deployment in DGWO.
To evaluate the learning behavior of the DQN decision model,
Figure 1 presents the cumulative episode reward and its 20-episode moving average during offline training. The raw rewards fluctuate because the four functions are cyclically selected and exploratory actions are performed under the
-greedy strategy. Nevertheless, the moving-average reward increases gradually and becomes relatively stable in the later episodes, indicating that the agent learns an effective leader-weight adjustment policy within 300 training episodes.
4.3. DGWO
Drawing upon the components introduced in the preceding sections, the complete DGWO algorithm is presented in this section. The overall procedure is illustrated in
Figure 2 and comprises three principal phases.
In the initialization phase, the algorithm loads the pre-trained decision model and randomly initializes the population within the search space, evaluates the fitness of each individual, ranks the population according to fitness, and identifies the , , and wolves. The leader wolf influence weights for each individual are initialized to , and a fitness history queue of length h is established for each individual.
Upon completion of initialization, the algorithm enters the dynamic search phase. At the beginning of each iteration, the current population diversity
is computed according to Equation (
20). For each individual
in the population, the fitness rank
and stagnation degree
are calculated according to Equations (
17) and (
18), respectively. The resulting three-dimensional state vector
, as defined in Equation (
16), is then constructed and fed into the pre-trained decision model to obtain the optimal weight adjustment action
for the current state. Based on this action, the leader wolf weights of individual
are adaptively updated according to Equations (
22)–(24). Subsequently, the three guided candidate positions
,
, and
produced by the respective leader wolves are computed according to Equations (
6)–(
11), and the final position update is carried out as a weighted combination of these candidates:
where
,
, and
are the guided candidate position vectors contributed by the
,
, and
wolves for individual
, respectively, and
,
,
are the leader wolf influence weights dynamically determined by the DQN decision model for individual
. Following the position update, the fitness of the new position is evaluated and the history queue
is updated accordingly. At the end of each iteration, the population is re-ranked and the
,
, and
wolves are updated. When the number of iterations reaches
, the algorithm terminates and returns the position of the
wolf as the best solution found.
4.4. Feature Selection Using the Proposed DGWO
FS is a critical step in the construction of intrusion detection systems, aiming to identify the most discriminative feature subset from the original feature pool in order to enhance detection performance, reduce computational complexity, and improve the generalization capability of the classification model. This section describes in detail how the DGWO algorithm is applied to the feature selection task in the context of network intrusion detection. The overall framework of the proposed DGWO-based feature selection method for network intrusion detection is illustrated in
Figure 3.
The fitness function serves as the core criterion for assessing the quality of candidate solutions, guiding the optimization algorithm in its search for the optimal configuration within the solution space. In the feature selection context, an ideal solution should simultaneously satisfy two objectives: achieving high classification accuracy and encompassing as few features as possible. To pursue this dual-objective optimization, the fitness function is formulated as follows:
where
denotes the classification error rate,
is the number of selected features, and
is the total number of features. The weights satisfy
, with
and
to prioritize classification performance while encouraging smaller feature subsets. The objective is to minimize the fitness value.
Data preprocessing constitutes an indispensable component of the machine learning pipeline, as its quality directly governs the performance of downstream models. The preprocessing workflow adopted in this study encompasses three core steps: data cleaning, feature encoding, and data normalization. To prevent data leakage, the training and testing sets were separated before data-dependent preprocessing. The encoding mappings and normalization parameters were fitted using only the training set and then applied unchanged to the testing set. In the data cleaning step, sample records containing missing values are removed alongside duplicate instances, thereby improving data quality and mitigating the risk of model overfitting. For feature encoding, categorical attributes present in the intrusion detection datasets, including protocol type, service type, and connection flag, are mapped to consecutive integers via label encoding, converting them into a numerically tractable representation. The original class labels were transformed into binary labels, where normal traffic was labeled as 0 and all attack types were uniformly labeled as 1. Finally, given the substantial variation in the value ranges across different features, all feature values are uniformly scaled to the interval
through min-max normalization, as expressed in Equation (
29):
where
X is the original feature value,
and
are the minimum and maximum values of that feature across the entire dataset, respectively, and
is the normalized feature value. Through these preprocessing steps, noise and inconsistencies in the raw data are eliminated, feature scales are unified, and favorable conditions are established for the efficient operation of both the feature selection algorithm and the classification model.
In the DGWO-based feature selection framework, each grey wolf individual represents a candidate solution vector whose length equals the total number of features
. Since feature selection requires each feature to be assigned one of two binary states, namely selected or discarded, the continuous solution vector must be discretized into a binary feature selection scheme. To this end, a threshold-based binarization method is employed, whereby each continuous position value is compared against a fixed threshold to determine whether the corresponding feature is included:
where
. Specifically,
indicates that the
j-th feature is selected, whereas
indicates that it is excluded from the candidate subset. For fitness evaluation, a K-Nearest Neighbor (KNN) classifier is employed owing to its low computational overhead, which makes it well-suited for the frequent fitness evaluations required during iterative optimization. It should be emphasized that KNN is used only as the internal fitness evaluator during the feature subset search process, rather than as the final classifier for performance assessment. To reduce overfitting, five-fold cross-validation is performed within the training set. The average validation error across the five folds is used as the classification error in the fitness function. The complete procedure of the DGWO-based feature selection algorithm is presented in Algorithm 1.
| Algorithm 1 DGWO-based Feature Selection for Intrusion Detection Systems |
Input: Preprocessed training set , population size , maximum iterations , pre-trained DQN model Output: Optimal feature subset
- 1:
Load dataset and pre-trained DQN model - 2:
Randomly initialize population - 3:
Binarize each to via Equation ( 30) - 4:
Evaluate fitness via Equation ( 28) using KNN on with features indicated by - 5:
Sort population P by fitness and identify , , wolves - 6:
Initialize and for all i - 7:
while
do - 8:
Compute population diversity via Equation ( 20) - 9:
for to do - 10:
Compute and via Equations ( 17)–( 18) - 11:
Construct state via Equation ( 16) - 12:
Select action - 13:
Update weights via Equations ( 22)–(24) - 14:
Compute guided positions via Equations ( 9)–( 11) - 15:
Update position - 16:
Binarize to via Equation ( 30) - 17:
Evaluate via Equation ( 28) using KNN on with features indicated by - 18:
Update fitness history - 19:
end for - 20:
Sort population P by fitness and update , , wolves - 21:
- 22:
end while
|
4.5. Complexity Analysis
The computational cost of DGWO consists of offline DQN training and online feature selection. During offline training, population evolution and state construction require operations per iteration, while the additional cost associated with action selection, experience replay, and network updating is denoted by . Therefore, the offline training time complexity is , where E is the number of training episodes, is the number of iterations per episode, is the population size, and d is the benchmark dimension.
During online feature selection, the pre-trained DQN performs only forward inference without gradient calculation or parameter updating. Population-state calculation and position updating require operations per iteration, while DQN-based action selection requires , where denotes the cost of one DQN forward pass. Therefore, the online time complexity of DGWO is , where T is the maximum number of iterations and is the total number of features. Since the DQN architecture is fixed, can be regarded as a constant. Thus, DGWO retains the same asymptotic time complexity, , as the standard GWO, although it introduces additional constant computational overhead.
In terms of space complexity, the offline training stage requires storage for the population, individual fitness-history queues, experience replay buffer, and DQN parameters. Let h denote the length of the fitness-history queue, R denote the capacity of the replay buffer, denote the state dimension, and denote the number of DQN parameters. The offline space complexity is therefore . During online feature selection, the replay buffer and network optimization information are no longer required. The main storage components include the population, individual fitness histories, state and weight information, and the pre-trained DQN parameters. Thus, the online space complexity is . Since h, , and the DQN architecture are fixed, the asymptotic online space complexity remains , which is of the same order as that of GWO, although DGWO requires a larger constant amount of storage.
The DQN is trained only once, and the resulting decision model can be reused in subsequent feature selection runs. Therefore, the offline training cost is separated from the online computational cost when evaluating the efficiency of DGWO. The additional computational overhead remains controllable, making DGWO feasible for practical deployment in feature selection tasks with fixed computing resources.
6. Conclusions
In this work, we proposed a Deep Reinforcement Learning-driven Grey Wolf Optimizer for feature selection in network intrusion detection systems. Specifically, a weight adjustment decision model is first pre-trained offline using deep reinforcement learning and then deployed to dynamically regulate the influence weights of the , , and wolves during the optimization process. This mechanism enables adaptive guidance of the search behavior and effectively enhances the algorithm’s optimization capability.
Experiments on the NSL-KDD, UNSW-NB15, and CIC-IDS-2017 datasets demonstrate that DGWO consistently outperforms seven competitive feature selection methods in terms of classification performance. Specifically, DGWO achieves the highest accuracy across all datasets, reaching 93.59%, 93.40%, and 94.84% on NSL-KDD, UNSW-NB15, and CIC-IDS-2017, respectively. Compared with the standard GWO, DGWO improves accuracy by approximately 0.72%, 2.25%, and 2.27%, while also achieving consistent improvements in F1-score of 0.61%, 2.33%, and 2.18%, respectively. In addition, DGWO significantly outperforms the standard GWO in terms of the average number of selected features. Specifically, the average feature subset size is reduced from 18.9 to 12.5 on NSL-KDD, from 18.3 to 13.2 on UNSW-NB15, and from 27.1 to 18.2 on CIC-IDS-2017, demonstrating that DGWO is capable of consistently producing more compact feature subsets while maintaining strong discriminative power. Ablation studies further validate the effectiveness of the key components of DGWO, particularly the DRL-based dynamic weight adjustment strategy and the designed state representation, both of which contribute to improved optimization performance and convergence behavior. These results confirm the effectiveness of incorporating adaptive decision-making into swarm intelligence optimization.
In future work, the proposed DGWO framework can be further extended in several directions. First, the current method can be generalized to multi-objective feature selection scenarios by jointly optimizing classification performance and additional objectives such as computational cost and model robustness. Finally, the proposed framework can be integrated with other advanced swarm intelligence or deep learning models to further enhance its adaptability in complex and dynamic intrusion detection scenarios.