Skip to Content
Applied SciencesApplied Sciences
  • Article
  • Open Access

23 November 2026

31 Pages

Multi-Stage Hybrid Feature Selection for SSAE–Attention-Based Network Intrusion Detection

,
,
,
and
Department of Information Security, Pai Chai University, Daejeon 35345, Republic of Korea
*
Author to whom correspondence should be addressed.
This article belongs to the Section Computing and Artificial Intelligence

Abstract

High-dimensional network traffic increases the resource demands of network intrusion detection systems (NIDSs). We evaluate a multi-stage hybrid feature selector combining XGBoost and ElasticNet rankings, mutual information (MI), and model-specific permutation importance (PI) with a stacked sparse autoencoder and attention (SSAE–Attention) binary detector. The originally selected feature sets reduced 78 inputs to 22 (71.8%) on CIC-IDS2017 and CSE-CIC-IDS2018. Across ten training seeds, the mean F1 was 0.9434 and 0.7942, respectively. Relative to 78 features, the mean F1 decreased by 0.0183 on CIC-IDS2017 (Holm-adjusted p = 0.0098) and by 0.0065 on CSE-CIC-IDS2018 (p = 1.0000); only the former decrease was statistically significant. SSAE–Attention parameters decreased by 32.7%. On CSE-CIC-IDS2018, the end-of-run process memory and training time fell by 52.3% and 7.4% on a single desktop CPU, while the forward-only time did not improve. At equal feature counts, the mean F1 lay between those of XGBoost-22 and ElasticNet-22. The reduction preserved much of aggregate detection performance, but the significant 2017 F1 loss and 2018 attack-type failures limit the interpretation. Real-time or constrained-device deployment requires separate validation.

1. Introduction

As network services diversify and connected environments become more complex, attack types and intrusion paths continue to evolve. Conventional signature-based intrusion detection can effectively identify known attack patterns but is limited in detecting previously undefined attacks or variants of existing attacks [1]. Consequently, machine-learning- and deep-learning-based network intrusion detection systems (NIDSs), which learn the characteristics of benign and attack traffic from data, have been studied extensively [1,2]. In particular, deep-learning-based NIDSs can learn complex nonlinear relationships among numerous network features and attack patterns and have therefore been applied to a wide range of intrusion detection tasks [3]. However, machine-learning-based NIDSs must also account for the gap between closed-world datasets and operational environments, changes in attack distributions, and generalization limitations [4].
However, network-flow data and public intrusion detection datasets may differ in their data composition and feature definitions [5], and not all features in network-flow data contribute equally to attack detection [6]. High-dimensional inputs may contain features that are useful for detection, features that convey similar or redundant information, and features that contribute little to attack discrimination. Using all such features as model inputs increases the amount of information to be processed, thereby increasing computational overhead and memory consumption during training and inference [7]. This increase in input dimensionality can reduce deployment efficiency, particularly when an NIDS processes large-scale network traffic or operates under constrained computing resources. Feature selection that removes unnecessary inputs while preserving detection-relevant information is therefore essential for balancing NIDS performance and computational efficiency [6].
Feature selection for NIDSs is closely related to the general problem of selecting informative variables while eliminating irrelevant ones [8]. Existing approaches include statistical methods such as mutual information (MI) [9], feature importance derived from tree-based models such as XGBoost [10,11], and regularization-based methods such as ElasticNet [12]. However, feature importance has different interpretations depending on the evaluation method. Tree-based methods can capture nonlinear relationships and interactions among features [10,11], whereas regularized linear models evaluate linear effects and redundancy from a different perspective [12]. MI measures statistical dependence between a feature and the class label independently of a specific predictive model [13], while permutation importance (PI) evaluates the actual predictive contribution of a feature from the decrease in predictive performance caused by randomly permuting its values [14]. Reliance on a single evaluation criterion may therefore cause the selected feature set to reflect a specific model or dataset characteristic disproportionately [6]. To address this limitation, feature utility should be reassessed sequentially from different evaluation perspectives. Previous studies have proposed ensemble or hybrid feature-selection methods that combine feature sets or importance rankings obtained using multiple methods [15,16]. These approaches reduce dependence on a single criterion by incorporating different feature-evaluation principles [15,16]. Nevertheless, most existing hybrid feature-selection studies have focused on combining feature sets or importance results produced by individual methods [15,16]. The sequential reduction of a common candidate set through repeated evaluation of nonlinear and linear characteristics, statistical associations with class labels, and actual predictive contributions has received comparatively limited attention.
To address these issues, we propose a multi-stage hybrid feature-selection procedure that sequentially assesses nonlinear and linear effects, associations with the class label, and actual predictive contributions. We also apply an SSAE–Attention classifier to the reduced input. The SSAE maps selected features into a sparse latent representation through hierarchical nonlinear transformations [17,18], while attention learns dimension-wise weights for classification [19]. The design is evaluated for feature reduction, detection performance, and measured computational-resource use.
The main contributions of this study are as follows:
  • We propose a multi-stage hybrid feature-selection procedure that progressively reduces a common candidate set through the XGBoost–ElasticNet intersection, MI reassessment, and dual-model PI intersection. These stages combine complementary evaluation criteria without claiming novelty for the individual algorithms.
  • We apply an SSAE–Attention-based intrusion detector to the reduced feature set. Its sparse latent representation and attention weights are designed to exploit information retained after feature selection; the contribution of attention is examined against a matched SSAE variant.
  • We separately assess stepwise feature reduction and the final feature set by comparing the XGBoost–PI and ElasticNet–PI candidates with their intersection, and by evaluating alternative selectors at an equal feature count.
  • We compare SAE–Attention, SSAE, and SSAE–Attention on the same final features to examine model architecture effects within the evaluated neural-network variants.
  • We evaluate detection performance, false positives and false negatives, training and forward-only time, parameter count, and memory before and after feature reduction.
The remainder of this paper is organized as follows. Section 2 reviews the development of NIDSs, feature selection and hybrid feature selection, and autoencoder- and attention-based intrusion detection. Section 3 describes the proposed multi-stage hybrid feature-selection method and SSAE–Attention-based intrusion detection model. Section 4 analyzes the stepwise feature-selection results and compares detection performance across feature-selection methods using the public CIC-IDS2017 and CSE-CIC-IDS2018 datasets [20,21]. It also evaluates detection performance before and after feature reduction, performance across model architectures using the final features, computational and resource efficiency, and misclassification characteristics. Section 5 interprets the results and discusses the limitations and future research directions. Section 6 concludes the paper.

3. Proposed SSAE–Attention NIDS with Multi-Stage Hybrid Feature Selection

As discussed in the related work, feature selection can reduce the processing burden of a network intrusion detection model by removing unnecessary or redundant inputs. However, when selection relies on a single evaluation criterion, the resulting feature set may disproportionately reflect a particular model or dataset characteristic. After feature reduction, the remaining nonlinear relationships must also be represented effectively, and the model must assign appropriate influence to information that is important for attack discrimination.
To address these requirements, this study proposes a multi-stage hybrid feature-selection method that sequentially combines XGBoost, ElasticNet, MI, and PI [10,12,13,14], together with an SSAE–Attention-based network intrusion detection architecture [17,18,19]. XGBoost and ElasticNet first identify candidate features considered important under different model characteristics, and MI reassesses their statistical association with the class label. PI then evaluates each feature’s contribution to actual predictive performance and determines the final feature set. The selected features are transformed into a sparse latent representation by the SSAE, and the attention layer weights the latent features according to their importance for classifying benign and attack traffic. The complete framework jointly addresses input reduction, preservation of detection information, and reduced computational and resource use.

3.1. Overall Framework

Figure 1 presents the overall framework of the proposed multi-stage hybrid feature-selection method and SSAE–Attention-based network intrusion detection model. The framework comprises network-traffic input, data preprocessing, multi-stage hybrid feature selection, SSAE–Attention-based latent representation learning, and benign-versus-attack classification.
Figure 1. Overall framework of the proposed multi-stage hybrid feature selection and SSAE–Attention-based NIDS.
Missing and invalid values are first processed in the network-flow data, which are then divided into training and test sets. Normalization parameters are fitted on training data only and applied to the test data. Feature selection likewise uses only the training data, so information from the test set cannot enter the selector.
The multi-stage hybrid feature-selection procedure consists of primary candidate-feature selection and a secondary PI-based evaluation. In the first stage, XGBoost and ElasticNet select features according to their respective importance criteria, and their intersection yields the features considered important by both methods. MI then evaluates the statistical association between each retained feature and the class label, producing the primary candidate-feature set.
In the second stage, XGBoost–PI and ElasticNet–PI are applied to the primary candidate-feature set. PI evaluates the actual predictive contribution of each feature from the performance change caused by perturbing its values. Features with high contributions in both PI evaluations are then retained as the final feature set.
The final selected features constitute the input to the SSAE–Attention model. The SSAE encoder hierarchically learns nonlinear relationships among the selected features and generates a sparse latent representation [17,18]. The attention layer learns the relative importance of each latent feature and assigns corresponding weights [19]. The weighted latent representation is passed to a fully connected classifier that labels the network traffic as benign or attack.

3.2. Multi-Stage Hybrid Feature Selection

The proposed multi-stage hybrid feature-selection procedure consists of primary candidate-feature selection and a secondary PI-based evaluation. In the first stage, XGBoost and ElasticNet assess feature importance under different model characteristics. MI is then applied to the intersection of their results to reassess the statistical associations with the class label. In the second stage, PI evaluates the contribution of each primary candidate feature to actual predictive performance and produces the final feature set. Figure 2 presents the complete multi-stage feature-selection procedure.
Figure 2. Detailed procedure of the proposed multi-stage hybrid feature-selection method.
In Stage 1, XGBoost evaluates the contribution of features to tree splits, reflecting nonlinear relations and interactions [10], while ElasticNet evaluates linear effects and redundancy through coefficients under L1 and L2 regularization [12]. The top 80% of features under each method are retained, and their intersection forms a broad candidate set for subsequent evaluation.
The intersection is reassessed using MI, which measures statistical dependence between each candidate and the class label independently of the predictive models [9,13]. The top 80% under MI are retained as the primary candidate set. Thus, Stage 1 sequentially combines two model-based perspectives with a statistical assessment.
In Stage 2, XGBoost and ElasticNet are each retrained on the primary candidate set, and PI is calculated separately for the two models. By permuting one feature and measuring the resulting change in predictive performance, PI estimates its contribution within each model [14]. The intersection of the top-ranked features in both PI results forms the final set.
The reference population for each retention ratio differs by stage. The 80% XGBoost and ElasticNet ratios apply to the original 78 features (62 per path), whereas the MI ratio applies to their intersection. In Stage 2, the PI target is 40% of the original 78 features rather than of the MI candidate set. Each path therefore targets ⌊0.40 × 78⌋ = 31 features; if fewer than 31 MI candidates remain, all candidates are retained.
The ratios preserve a broad candidate pool in Stage 1 and then select features rated highly for predictive contribution by both models in Stage 2. The same fixed ratios and reference populations are used for both datasets; they were not optimized to maximize detection performance on either dataset. Actual stage-wise counts are given in Section 4.2.1, and sensitivity to these ratios is examined in Section 4.2.4. Implementation settings for the feature selector in the fixed-column-order re-execution are documented in Supplementary Table S10; these settings do not independently verify every parameter of the original Final-22 run.

3.3. SSAE–Attention-Based Intrusion Detection Model

The final features obtained by the procedure in Section 3.2 are passed to the SSAE–Attention detector. The model transforms nonlinear relations among reduced input features into a sparse latent representation and weights latent dimensions differently. Figure 3 illustrates its training and inference paths.
Figure 3. Training and inference procedure of the SSAE–Attention-based intrusion detection model. Horizontal solid arrows indicate the inference data flow, whereas the dashed decoder branch and the downward loss branch are used only during training.
The selected features enter the SSAE encoder, whose dimensions are d → 128 → 64 → 32, to produce the latent vector, z. Here, d denotes the input dimension, that is, the number of features retained by the multi-stage selection procedure in Section 3.2. The latent vector enters attention and reconstruction paths. Attention computes dimension-wise weights, a, and passes the weighted latent representation, z ~   =   z   ⊙   a , to the classifier, which outputs logits for binary detection. The decoder reconstructs the input from the pre-attention z.
During training, the classification loss, LCE; reconstruction loss, LMSE; and sparsity penalty, Lsparse, are combined in the objective L = LCE + 0.05 LMSE + 0.001 Lsparse. The encoder, attention, classifier, and decoder are optimized jointly without separate pretraining. At inference, the input passes through the encoder, attention, and classifier. Full layer, sparsity, and training settings are given in Supplementary Table S10.

4. Experiments and Results

This section evaluates the proposed feature selector and SSAE–Attention model on CIC-IDS2017 and CSE-CIC-IDS2018. It compares detection performance and computation after feature reduction, and examines selection stability, retention-ratio sensitivity, and model components.

4.1. Experimental Environment and Settings

4.1.1. Datasets and Data Preprocessing

The experiments used CIC-IDS2017 [20] and CSE-CIC-IDS2018 [21]. For CIC-IDS2017, the CSV files were combined, whitespace was stripped from column names, and Flow ID, IP-address, and Timestamp fields were excluded where present. The resulting dataset contained 2,830,743 flow records with 78 input features and a label. For CSE-CIC-IDS2018, 59 repeated header rows were removed from 16,233,002 rows in ten CSV files, leaving 16,232,943 records. Because the file schemas differed, the label and Flow ID, Src IP, Dst IP, and Timestamp fields were excluded and 78 input columns shared by the training and test files were retained. Non-numeric, missing, and infinite values were replaced with zero in both datasets; duplicate records were not removed.
The primary task was binary benign-versus-attack classification, with benign mapped to 0 and attack to 1. Original attack labels were retained for the per-type recall analysis on CSE-CIC-IDS2018 in Section 4.4. Supplementary Table S6 presents an additional 15-class analysis on CIC-IDS2017, since binary aggregates may mask differences among rare attack categories.
CIC-IDS2017 was split using stratified random 80/20 sampling (test_size = 0.2, random_state = 42), producing 2,264,594 training and 566,149 test samples. Although stratification preserves class proportions, similar traffic patterns may occur in both partitions. The result should therefore not be interpreted as generalization to traffic from a different time period or capture environment.
CSE-CIC-IDS2018 used a capture-file holdout: three Friday CSV files (3,145,724 samples) formed the fixed test set, and the other seven files (13,087,219 samples) formed the training set. Traffic from a single capture file did not occur in both partitions. Bot, DoS attacks–Hulk, and DoS attacks–SlowHTTPTest occurred only in the Friday files and were therefore present in the test set but absent from training. This file-based evaluation differs from random 80/20 sampling and does not constitute a chronological train-to-future split. Their detection is interpreted in this context in Section 4.4.
For the corrected model evaluation, Min–Max normalization parameters were fitted on the training partition and applied unchanged to the test partition. The original CIC-IDS2017 Final-22 feature set had been selected on data normalized with parameters fitted on the full dataset. In fixed-column-order re-executions, the stage-wise selected sets before and after the normalization correction were identical (20 final features in each); this comparison does not establish that the original 22 features were unaffected. We retained the originally reported Final-22 as a fixed feature set and retrained the neural models using training-only normalization. The re-executed feature selection and the CSE-CIC-IDS2018 original selection used training data only. The test set was reserved for model evaluation. Only the retention-ratio sensitivity experiment (Section 4.2.4) used a stratified 10% validation subset within training data (seed 42); other models were trained on the full training partition. Dataset sizes, splits, and preprocessing are summarized in Table 2.
Table 2. Experimental datasets, splits, and preprocessing settings.

4.1.2. Experimental Environment and Model Training Settings

All experiments, including feature selection, model training, inference, and resource measurement, were conducted on a CPU: an AMD Ryzen 9 9900X3D processor (12 cores, 24 threads) with 64 GB of memory running Windows 10, with Python 3.9.25 and PyTorch 2.5.1 (CPU build). PyTorch’s default thread setting was used without fixing the number of threads. All models were trained and evaluated under the same hardware and software conditions.
SAE–Attention and SSAE were used as comparison models to evaluate the structural contribution of SSAE–Attention. SSAE has the same structure and loss coefficients as SSAE–Attention with the attention module removed, and SAE–Attention uses a two-layer encoder (64 → 32) with attention and no decoder (Table S10). Except for the input layer, the hidden-layer architecture and classification settings were the same for Full-78 (all 78 input features) and Final-22 (the 22 features per dataset from the original selection run).
All models were trained using the Adam optimizer with a learning rate of 0.001 and a batch size of 1024 for 10 epochs without early stopping. The classification, reconstruction, and sparsity losses were optimized jointly without separate pretraining (Section 3.3). To evaluate the variation due to training randomness, each configuration in the main comparisons was trained with ten training seeds (seeds 1–10) on the fixed training and test sets, and the results are given as means ± standard deviations. The stage-wise reduction and component ablation used five seeds (seeds 1–5), and the single-run comparisons in Section 4.2.2 and Section 4.2.3 used training seed 1, which was fixed before the runs.
Computational cost was measured as follows. Training time is the wall-clock time of the 10-epoch training loop, measured from the creation of the model and optimizer to the end of the loop; it excludes data loading, test inference, and feature selection (Table S8). Forward time was measured with the saved seed-1 model by processing the entire test set in a single forward call after a warm-up run; the call was repeated five times, and the time was converted to a per-sample value. This forward-only time excludes data loading, metric computation, and post-processing, and it is not a single-request latency. Process memory is the resident set size (RSS) reported by the operating system at the end of a run (training and test inference) and is given as the mean ± SD over the ten training seeds. The parameter size was calculated as the number of parameters × 4 bytes, and the input matrix size as rows × features × 4 bytes. Process memory was also measured separately right after input loading and at its peak during inference and training with different batch sizes, in five runs per condition, each in a new process (Table S9). The CPU time of each feature-selection stage was measured separately from model training and inference (Table S8).

4.1.3. Evaluation Metrics

Detection performance was evaluated using accuracy, precision, recall, F1-score, false-alarm rate (FAR), false-negative rate (FNR), and balanced accuracy. Accuracy is the proportion of all samples for which benign and attack traffic are classified correctly and is calculated as follows:
Accuracy   =   TP   +   TN TP   +   TN   +   FP   +   FN
Here, TP (true positive) denotes attack traffic correctly identified as an attack and TN (true negative) denotes benign traffic correctly classified as benign. FP (false positive) denotes benign traffic incorrectly classified as an attack, whereas FN (false negative) denotes attack traffic incorrectly classified as benign.
The F1-score is the harmonic mean of precision and recall and jointly reflects precision and sensitivity in attack detection. Precision and recall are defined as follows:
Precision   =   TP TP   +   FP
Recall = TP TP + FN
The F1-score is then calculated as follows:
F 1 - score   =   2   ×   Precision   ×   Recall Precision   +   Recall
FAR is the proportion of benign traffic incorrectly classified as an attack and is calculated as follows:
FAR   =   FP FP   +   TN
Accuracy measures overall classification correctness, whereas the F1-score reflects the balance between precision and recall for attack detection. FAR quantifies the extent to which benign traffic is incorrectly flagged as an attack and is therefore used to evaluate the false-alarm burden in an operational intrusion detection environment.
Computational and resource efficiency after feature reduction was evaluated using training time, inference time per sample, the number of trainable parameters, model size, and memory usage [6,7]. Training and inference times indicate computational efficiency, whereas parameter count, model size, and memory usage characterize differences in model complexity and resource requirements. These measures were used to evaluate changes in both detection performance and computational-resource use between the full and final feature sets.

4.2. Results and Performance Comparison of the Proposed Feature-Selection Method

This section examines stage-wise reduction, selection stability over training subsamples, and the detection performance of the selected features, including a rerun with fixed column order. It also compares equal-sized selectors, retention-ratio sensitivity, and the effects of individual stages and components. ElasticNet issued convergence warnings on CSE-CIC-IDS2018 at max_iter = 5000; the rankings and final set remained the same when the iteration limit was raised to 50,000, but convergence was not established. Analyses using this fit are not interpreted as results from a converged optimum.

4.2.1. Stepwise Feature Reduction and Final Feature Selection

The proposed feature-selection method was applied independently to the two datasets. For each dataset, the procedure started with the 78 features used as model inputs after preprocessing and sequentially applied XGBoost- and ElasticNet-based feature-importance evaluation, the intersection of their results, MI-based reassessment, and secondary evaluation using XGBoost–PI and ElasticNet–PI [10,12,13,14].
Table 3 reports the number of features retained at each stage, together with a re-execution of the same procedure under a fixed column order and stable tie-breaking rule. In the original run, XGBoost and ElasticNet each selected the top 80%, corresponding to 62 features; their intersection retained 56 features for CIC-IDS2017 and 54 features for CSE-CIC-IDS2018. MI then reassessed the statistical associations with the class label among the features considered important by both XGBoost and ElasticNet, retaining the top 80% and producing 44 primary candidate features for CIC-IDS2017 and 43 for CSE-CIC-IDS2018. XGBoost–PI and ElasticNet–PI each then selected the top 40%, that is, floor(0.40 × 78) = 31 features, and the intersection of the two PI results yielded 22 final features for each dataset, a reduction from 78 input features of approximately 71.8%. On re-execution, the stage counts were identical through the MI stage for both datasets; the final intersection yielded 20 features for CIC-IDS2017, of which 16 were shared with the original 22-feature set, and 22 features for CSE-CIC-IDS2018, of which 18 were shared with the original set. The differences occurred among boundary features at the PI stage because the stage-wise intersection column order was not fixed in the original run; the fixed-order re-execution reproduced its selected sets.
Table 3. Stepwise results of the proposed multi-stage hybrid feature selection (original record and re-execution).
In Table 3, “Original” refers to the first selection record and “Re-execution” to a rerun with fixed column order and tie handling. The PI path retains min(31, number of candidates) features. The sets on CIC-IDS2017 agreed through the MI stage but differed among borderline PI features. On CSE-CIC-IDS2018, stage counts were unchanged and four final features were replaced.
Table 4 lists the final 22 features selected for each dataset. The selected features include packet length and traffic volume, inter-arrival time (IAT), forward and backward traffic characteristics, packet rate, and active and idle times, which characterize the scale and temporal variation of network flows.
Table 4. Final 22 features selected for each dataset (original record).
The feature lists in Table 4 are the originally selected inputs used for detection and efficiency analyses. Feature-selection frequencies and the re-executed selections appear in Supplementary Table S7.
To examine the stability of the selected feature set, the proposed procedure was repeated on ten stratified 90% subsamples of the training data using the fixed implementation, without training any neural network. Table 5 reports the resulting variation in the final feature set.
Table 5. Stability of the selected feature set over ten stratified training subsamples.
Across the ten subsamples, the features selected in every subsample numbered seven for CIC-IDS2017 and eight for CSE-CIC-IDS2018, and the features selected in at least eight of the ten subsamples numbered twelve for both datasets—more than half of the mean final feature count per subsample (20.10 and 22.40, respectively). Among the final feature sets obtained from the fixed re-execution in Table 3, eleven of the 20 CIC-IDS2017 features and eleven of the 22 CSE-CIC-IDS2018 features were also selected in at least eight of the ten subsamples. The features whose selection varied across subsamples (boundary features) were concentrated near a permutation-importance value of zero; for example, on CIC-IDS2017 the number of ElasticNet–PI features with positive importance averaged 30.7 of the 44 MI-stage candidates, close to the PI target of 31, so selection near this boundary may have been sensitive to the ordering of features with near-zero importance. These results indicate that a core subset of features is repeatedly identified across resamples, while the composition of the remaining boundary features varies with the training subsample.
The sets in Table 5 were obtained by repeating feature selection on ten stratified 90% training subsamples (sampling seeds 1–10), without neural-network training. The 45 pairwise Jaccard comparisons share the same ten sets and should not be treated as independent replicates. Per-feature selection frequencies are given in Supplementary Table S7.

4.2.2. Performance Comparison of PI Candidate and Final Feature Sets

To assess the effect of further reducing the 31 candidate features selected at the PI stage to the final 22 features, the 31-feature XGBoost–PI set, the 31-feature ElasticNet–PI set, and the final 22-feature set, all from the original feature lists, were retrained on the corrected training-set-only normalization and each was applied to the same SSAE–Attention model (single run, training seed 1); the multi-seed results are given in Section 4.2.3.
Table 6 presents the results for CIC-IDS2017. The 31-feature ElasticNet–PI set achieved an accuracy of 0.9844 and an F1-score of 0.9609, whereas the final 22 features achieved 0.9831 and 0.9577, respectively. Although the number of features decreased from 31 to 22, the differences in accuracy and F1-score were only 0.0013 and 0.0032, respectively. The 31-feature XGBoost–PI set produced the lowest accuracy and F1-score among the three conditions, at 0.9530 and 0.8701, reflecting a markedly lower recall (0.7985) than ElasticNet–PI (0.9707) and the final set (0.9743).
Table 6. Performance comparison of PI candidate subsets and the final selected feature set on CIC-IDS2017.
Table 6 contains the seed-1 SSAE–Attention results after retraining the original feature lists on the corrected preprocessing. Multi-seed comparisons are presented in Section 4.2.3.
Table 7 presents the results for CSE-CIC-IDS2018. The 31-feature ElasticNet–PI set achieved the highest accuracy and F1-score among the three conditions (0.9081 and 0.8058), together with a markedly lower FAR (0.000035). The final 22-feature set produced the lowest accuracy and F1-score (0.8695 and 0.7452), followed by the 31-feature XGBoost–PI set (0.8827 and 0.7647). Recall was comparable across the three sets (0.6747–0.6759).
Table 7. Performance comparison of PI candidate subsets and the final selected feature set on CSE-CIC-IDS2018.
Table 7 shows SSAE–Attention with training seed 1. This was the lowest-F1 seed for the proposed feature set on CSE-CIC-IDS2018, so the single-run ranking should be read alongside the repeated results in Section 4.2.3.
Across the two datasets, the final 22-feature sets had lower dimensionality than the 31-feature candidate sets selected separately by XGBoost–PI and ElasticNet–PI. Relative to ElasticNet–PI, the final set reduced accuracy and F1-score by 0.0013 and 0.0032 for CIC-IDS2017, and by 0.0386 and 0.0606 for CSE-CIC-IDS2018, while recall was comparable to ElasticNet–PI on both datasets. The ten-seed comparison in Section 4.2.3 indicates that this single-run ranking on CSE-CIC-IDS2018 is sensitive to the choice of training seed, since seed 1 is the lowest-F1 seed for the proposed final set on that dataset.

4.2.3. Comparison of Feature-Selection Methods Using Equal Numbers of Features

To compare the effectiveness of the features selected by the proposed method, 22 features were selected using random selection, XGBoost, ElasticNet, MI, and the proposed method, and each feature set was applied to the same SSAE–Attention model, retrained on the corrected data (single run, training seed 1) [10,12,13]. Fixing the number of features at 22 in all conditions separated the effect of feature count from the performance differences attributable to the selection method [28]. For random selection, five sets of 22 features were sampled independently from the 78 features for each of CIC-IDS2017 and CSE-CIC-IDS2018, and the mean result across the five sets was used as the comparison value. Paired multi-seed comparisons between the proposed method and XGBoost and ElasticNet are given later in this section.
On CIC-IDS2017 (Table 8), the proposed set attained an accuracy of 0.9831 and an F1-score of 0.9577, which values were close to those of ElasticNet-22 (0.9840 and 0.9598). Its FAR of 0.014775 was higher than ElasticNet-22’s 0.012597. XGBoost-22 and MI-22 had a lower accuracy and F1 than the proposed set. Five random 22-feature lists gave a mean accuracy of 0.9314 ± 0.0333 and an F1 of 0.8053 ± 0.1146.
Table 8. Comparison of feature-selection methods using 22 features on CIC-IDS2017.
The Random row in Table 8 contains the means ± SDs across five different randomly selected feature lists evaluated at training seed 1, not five training seeds. Multi-seed paired comparisons with XGBoost-22 and ElasticNet-22 are reported later in this section.
On CSE-CIC-IDS2018 (Table 9), XGBoost-22 attained the highest single-run accuracy (0.9084) and F1 (0.8065), with ElasticNet-22 close behind (0.9038 and 0.7950). The proposed set attained 0.8695 accuracy and 0.7452 F1 and had the highest FAR (0.054297) of the compared methods. Seed 1 was its lowest-F1 seed; its ten-seed mean F1 was 0.7942 (Table 10). Random selection and MI performed less well than the model-based methods on these aggregate metrics.
Table 9. Comparison of feature-selection methods using 22 features on CSE-CIC-IDS2018.
Table 10. Multi-seed comparison of feature sets and paired tests of the F1-score (M2 versus each comparison). (a) CIC-IDS2017. (b) CSE-CIC-IDS2018.
The Random row in Table 9 averages five distinct random feature lists at training seed 1. Table 10 evaluates paired differences with XGBoost-22 and ElasticNet-22 over ten training seeds.
Reducing each 31-feature PI candidate set to the 22-feature intersection yielded a smaller input. Compared with ElasticNet–PI at seed 1, the proposed set had accuracy and F1 values that were lower by only 0.0013 and 0.0032 on CIC-IDS2017, but by 0.0386 and 0.0606 on CSE-CIC-IDS2018. At equal dimensionality, it approached ElasticNet-22 on CIC-IDS2017 but ranked below XGBoost-22 and ElasticNet-22 in the single-seed 2018 comparison. Table 10 extends these comparisons to ten seeds with paired tests.
Table 10 summarizes the means ± SDs across ten training seeds. ΔF1 is the paired mean difference between M2 and each comparator, with a t-based 95% confidence interval. The two-sided exact Wilcoxon signed-rank p-values were Holm-adjusted for five comparisons per dataset. A non-significant result does not establish equivalence or non-inferiority. M6 uses an independently configured MI∩Boruta selector (Supplementary Table S1), and M5 removes attention from M2. Additional metrics are detailed in Supplementary Table S5.
Over ten seeds, the proposed original Final-22 set (M2) did not differ significantly from XGBoost-22, ElasticNet-22, or the no-attention SSAE variant on either dataset (all adjusted p > 0.05). It also did not differ significantly from MI∩Boruta-22 on CIC-IDS2017. Relative to Full-78, its F1 was significantly lower on CIC-IDS2017 (ΔF1 = −0.0183; p = 0.0098) but not on CSE-CIC-IDS2018 (p = 1.0000). On CSE-CIC-IDS2018, M2 exceeded MI∩Boruta-22 (ΔF1 = +0.3680; p = 0.0098). Thus, a single-seed ranking does not establish a consistent ordering, although the latter difference persisted across repeated runs.

4.2.4. Sensitivity to Retention Ratios

The baseline retention ratios of the proposed procedure (80% for the XGBoost and ElasticNet importance filters, 80% for the MI reassessment, and 40% for PI, that is, floor(0.40 × 78) = 31) were fixed in advance and are not claimed to be optimal. To examine the sensitivity of the final feature count and validation performance to these ratios, each ratio was varied individually while the others were held at baseline, with features selected on a stratified 90% training subset and evaluated on the remaining 10% validation subset (split seed 42; SSAE–Attention, training seed 1); the test set was not used. Table 11 summarizes the final feature counts and validation F1-scores.
Table 11. Sensitivity of the final feature count and validation F1 to the retention ratios.
For Table 11, one retention ratio was varied at a time while the other baseline values (80/80/40) were fixed. The PI targets based on 78 original inputs were 23, 31, and 39 at 30%, 40%, and 50%, respectively, with all candidates retained when fewer were available. Selection used a stratified 90% training subset and validation used the remaining 10%, without test-set access. Full results are in Supplementary Table S3.
The final feature count and validation F1 both varied with the retention ratios, and the direction of the change was not always the same for the two datasets. Raising the XGBoost/ElasticNet retention ratio to 90% (A2) reduced the final count and raised the validation F1 on CIC-IDS2017 (0.9564) but lowered the final count with a smaller F1 change on CSE-CIC-IDS2018 (0.9433); lowering it to 70% (A1) increased the final count on both datasets while lowering CIC-IDS2017 F1 (0.8860) and raising CSE-CIC-IDS2018 F1 (0.9539). Widening the PI target (C2, 50%) increased the final count and raised the CIC-IDS2017 validation F1 to its highest value in this sweep (0.9593) but lowered theCSE-CIC-IDS2018 F1 to its lowest value (0.8641). These results indicate that the baseline ratios do not uniformly dominate the alternatives examined and that the sensitivity of the procedure to its retention ratios differs by dataset; a systematic search over ratio combinations was not performed and is left to future work.

4.2.5. Stage-Wise Reduction and Component Ablation

To examine the contribution of the individual stages of the proposed procedure, the re-executed feature-selection pipeline was decomposed stage by stage, and each of the four selection components (XGBoost, ElasticNet, MI, and PI) was removed in turn while the remaining components were kept unchanged. SSAE–Attention was trained on five training seeds for each resulting feature set. Table 12 reports the stage-wise feature counts and F1-scores (panel a) and the effect of removing each component (panel b); full metrics with 95% confidence intervals are given in Supplementary Table S4.
Table 12. Stage-wise reduction and component ablation of the feature-selection procedure (five training seeds). (a) Stage-wise reduction. (b) Component ablation.
Table 12 presents five-seed F1 means and SDs for feature sets obtained from the re-executed procedure. S3 and S4 are alternative PI paths from S2; S5 is their intersection. Because the configurations also change feature count, their differences cannot isolate one stage’s effect. Accuracy, FAR, FNR, and 95% confidence intervals appear in Supplementary Table S4.
The stage-wise results show that F1 changed little through the XGBoost ∩ ElasticNet intersection (S1) on both datasets, decreased after the MI reassessment and more sharply after PI on CIC-IDS2017 (S2–S3), and was more variable on CSE-CIC-IDS2018, where the MI stage produced the largest drop and variance (S2, F1 = 0.6911 ± 0.2160). The component ablation indicates that no single component was uniformly necessary for the highest F1 in this five-seed comparison: removing MI gave a slightly higher mean F1 than the full procedure on both datasets (0.9458 versus 0.9430 on CIC-IDS2017; 0.8059 versus 0.7933 on CSE-CIC-IDS2018), while removing ElasticNet gave the lowest F1 on CIC-IDS2017 (0.8950) and removing PI gave the most variable F1 on CSE-CIC-IDS2018 (0.6911 ± 0.2160). Because the feature count differs across configurations, these differences reflect the combined effect of the component and the resulting dimensionality rather than the isolated contribution of one component; the full procedure is retained in this study on the basis of the final feature count and the stability analysis of Section 4.2.1, rather than because it uniquely maximized F1 in this ablation.

4.3. Detection Performance and Resource Efficiency After Feature Reduction

This section compares detection performance and model-architecture effects using the full 78 features and the final 22 features over ten training seeds and analyzes the changes in computational and resource efficiency resulting from feature reduction.

4.3.1. Detection Performance Before and After Feature Reduction

To evaluate the change in detection performance caused by input-feature reduction, SSAE–Attention was trained on ten training seeds using the full 78 features and the final 22 features, both retrained on the corrected training-set-only normalization. Table 13 presents the mean ± SD performance for both datasets, together with balanced accuracy and the FP and FN counts on the test set.
Table 13. Detection performance of SSAE–Attention before and after feature reduction (ten training seeds). (a) CIC-IDS2017. (b) CSE-CIC-IDS2018.
Table 13 shows ten-seed means and SDs after retraining the original feature lists on corrected preprocessing. The difference rows are means of within-seed differences. FP and FN values are test-set counts. The confusion matrices in Section 4.4 show one run (seed 1), which should not be conflated with the ten-seed means.
For CIC-IDS2017, reducing the feature count from 78 to 22, corresponding to a 71.8% reduction, decreased mean accuracy and F1-score by 0.0068 and 0.0183, respectively, over ten training seeds, and increased mean FAR by approximately 0.0018; this F1 decrease was statistically significant (Table 10, p = 0.0098). For CSE-CIC-IDS2018, the same reduction ratio decreased mean accuracy and F1-score by only 0.0022 and 0.0065, respectively, a difference that was not statistically significant (Table 10, p = 1.0000).
The mean F1 change on CSE-CIC-IDS2018 was small after reduction, whereas the F1 loss on CIC-IDS2017 was statistically significant. The latter also showed greater seed-to-seed F1 variability with Final-22 (SD 0.0223 versus 0.0009 for Full-78). Thus, the reduced set retained much of the aggregate detection signal but increased sensitivity to training seed on CIC-IDS2017; the 2018 mean difference was not significant.

4.3.2. Comparison of Model Architectures Using the Final Features

To evaluate the effect of combining an SSAE, which learns a sparse latent representation from the reduced features, with attention, which differentially weights latent features by importance, the detection performance of SAE–Attention, SSAE, and SSAE–Attention was compared using the final 22 features over ten training seeds, retrained on the corrected data [17,18,19]. SSAE and SSAE–Attention share the same structure and loss coefficients (reconstruction coefficient: 0.05); only the attention module differs. SAE–Attention uses a 64→32 encoder without a decoder and the classification loss only, so its comparison reflects the whole model configuration rather than isolating the effect of attention alone. Table 14 presents the mean ± SD performance of the three models on both datasets.
Table 14. Detection performance of models using the final 22 features (ten training seeds). (a) CIC-IDS2017. (b) CSE-CIC-IDS2018.
In Table 14, the paired mean F1 differences between SSAE–Attention and SSAE were +0.0042 on CIC-IDS2017 and +0.0076 on CSE-CIC-IDS2018. The corresponding Holm-adjusted p-values were 0.6250 and 1.0000 (Table 10), so neither difference was significant.
On CIC-IDS2017, SSAE–Attention attained the highest mean accuracy (0.9779) and F1 (0.9434) of the three variants and the lowest mean FAR (0.014193). On CSE-CIC-IDS2018, SAE–Attention attained the highest mean accuracy (0.9024) and F1 (0.7967) and the lowest FAR (0.008091); SSAE–Attention attained an accuracy of 0.9009 and an F1 of 0.7942, while SSAE had the lowest F1 (0.7866). Comparisons included in Table 10 were not significant after Holm correction.
The SSAE learns a sparse nonlinear representation of the selected inputs. Attention yielded only small, non-significant mean F1 differences relative to SSAE, with a lower average FAR in both datasets but considerable seed variability on CSE-CIC-IDS2018. SSAE–Attention ranked first in mean F1 among the three variants on CIC-IDS2017 and close to SAE–Attention on CSE-CIC-IDS2018. These data do not establish an independent performance benefit from attention.

4.3.3. Computational and Resource Efficiency After Feature Reduction

To evaluate improvements in computational and resource efficiency together with changes in detection performance, training time, inference time, parameter count, model size, and memory usage were compared between the full 78-feature and final 22-feature conditions.
Table 15 presents the changes in computation and resource use before and after feature reduction for CIC-IDS2017, measured on CPU (AMD Ryzen 9 9900X3D; Windows 10; Python 3.9.25; PyTorch 2.5.1 CPU build). Using the final 22 features reduced parameter count and model size by 35.8% for SAE–Attention, 34.3% for SSAE, and 32.7% for SSAE–Attention. For SSAE–Attention, process memory at the end of a run decreased by approximately 36.6%, training time decreased by approximately 4.0%, and forward time per sample changed by less than 0.02 µs. Feature reduction therefore decreased model complexity and process memory on CIC-IDS2017, while the change in forward time was small.
Table 15. Computational efficiency with full features and the final 22 features on CIC-IDS2017 (CPU).
Table 15 training times and process memory values are means ± SDs across ten training seeds. Forward-only time was measured by passing the full test set once through the saved seed-1 model after warm-up, repeated five times; it excludes loading, metrics, and postprocessing and does not represent individual-request latency. End-of-run memory is process RSS after training and test inference. Parameter size and training-input size are calculated as parameter count × 4 bytes and rows × features × 4 bytes. Full-78 SAE–Attention and SSAE were not trained: only structural parameter and calculated input sizes are shown. Dashes denote unmeasured values; checkpoint sizes and time confidence intervals appear in Supplementary Table S8.
Table 16 presents the corresponding CPU measurements for CSE-CIC-IDS2018. Using the final 22 features reduced the parameter count and model size by the same model-specific proportions as on CIC-IDS2017: 35.8% for SAE–Attention, 34.3% for SSAE, and 32.7% for SSAE–Attention. For SSAE–Attention, end-of-run process memory decreased by approximately 52.3% and training time by approximately 7.4%, while forward time per sample did not decrease (+0.6%, within the variation of five repetitions). The calculated size of the training and test input matrices fell from 4830.1 to 1362.3 MiB, accounting for most of the process-memory reduction.
Table 16. Computational efficiency with full features and the final 22 features on CSE-CIC-IDS2018 (CPU).
Table 16 follows the same measurement definitions as Table 15. On CSE-CIC-IDS2018, SSAE–Attention forward-only time changed from 0.452 to 0.455 μs per sample, so no inference speed-up was observed. The combined calculated size of training and test input matrices fell from 4830.1 to 1362.3 MiB; the resident process includes these arrays. Stage-wise selection costs are in Supplementary Table S8.
Figure 4 compares the measured percentage reductions in SSAE–Attention parameters, training time, end-of-run process memory, and calculated training-input size from Full-78 to Final-22, based on Table 15 and Table 16.
Figure 4. Reduction rates of computational resources from Full-78 to Final-22 (SSAE–Attention).
For SSAE–Attention, parameter count and model size decreased by approximately 32.7% on both datasets, process memory decreased by approximately 36.6% on CIC-IDS2017 and 52.3% on CSE-CIC-IDS2018, and training time decreased by approximately 4.0% on CIC-IDS2017 and 7.4% on CSE-CIC-IDS2018; forward time per sample changed little on CIC-IDS2017 and did not decrease on CSE-CIC-IDS2018. These efficiency gains accompanied a mean F1 decrease of 0.0183 (statistically significant) on CIC-IDS2017 and 0.0065 (not statistically significant) on CSE-CIC-IDS2018 over ten training seeds (Table 13). Thus, a 71.8% reduction in input dimensionality substantially reduced parameter count, model size, and process memory on both datasets, with a comparatively small and dataset-dependent change in training and forward time.

4.4. Misclassification Analysis After Feature Reduction

This section first examines recall by attack type on CSE-CIC-IDS2018, including attack types absent from the training data, and then analyzes changes in FPs and FNs before and after feature reduction using the SSAE–Attention confusion matrices, providing information on misclassification behavior that is not fully captured by accuracy and F1-score.
Table 17 gives attack-type recall as the mean ± SD over ten seeds. Per-type precision and F1 cannot be computed from the binary output. Full-78 Bot recall was driven largely by seed 8 (127,941 of 286,191 cases detected); the other nine seeds detected 0–79 cases. Final-22 detected no Bot cases in any seed, and Bot accounted for 98.9–99.4% of its false negatives. Bot, DoS attacks–Hulk, and DoS attacks–SlowHTTPTest were absent from training. This file-holdout result does not establish general detection of previously unseen attack categories.
Table 17. Attack-type recall of the binary model on CSE-CIC-IDS2018 (ten training seeds).
Recall varied widely across attack types and was generally low for the minority attack types with few training instances (Brute Force-Web, Brute Force-XSS, and SQL Injection), regardless of feature set. For the two majority attack types with zero training instances (DoS attacks–Hulk and DoS attacks–SlowHTTPTest), recall was close to 1.0 for both feature sets, whereas Bot, the third attack type absent from training, was detected in essentially none of the ten seeds by either model; this indicates that the absence of an attack type from training does not by itself predict whether it will be detected; the model’s recall instead depended on the specific attack type. Because the Friday-file holdout is file-based rather than temporally split in a controlled way, these results characterize generalization to the held-out files of this dataset and are not evidence of detecting previously unseen attack categories in general.
Figure 5 shows the four seed-1 confusion matrices for SSAE–Attention under Full-78 and Final-22. Ten-seed aggregate results are in Table 13. On CIC-IDS2017, the TN, FP, FN, and TP counts were 449,308, 5312, 3616, and 107,913 for Full-78 and 447,903, 6717, 2871, and 108,658 for Final-22. Feature reduction increased FP by 1405 while reducing FN by 745 in this one seed. The FP increase agreed in direction with the ten-seed mean increase (+825.5), but the FN decrease did not represent the lower average recall across seeds (0.9729 ± 0.0045 to 0.9456 ± 0.0499).
Figure 5. Confusion matrices of SSAE–Attention using the full and final feature sets (single run, training seed 1).
For CSE-CIC-IDS2018 at seed 1, the TN, FP, FN, and TP counts were 2,256,916, 249, 289,536, and 599,023 for Full-78 and 2,134,608, 122,557, 288,023, and 600,536 for Final-22. The seed-1 FP values fell on opposite sides of their ten-seed means (28,945 ± 47,779 and 23,096 ± 40,409, respectively). This reflects large seed-to-seed FP variability in both configurations, rather than a systematic FP increase after reduction. FN varied less, particularly for Final-22 (SD 543). Accordingly, Figure 5 illustrates a single realization; detection conclusions rely on the ten-seed results in Table 13.
The misclassification analysis therefore shows a small mean F1 change on CSE-CIC-IDS2018 but a significant loss on CIC-IDS2017, substantial variation in recall among attack categories on CSE-CIC-IDS2018 (Table 17), and FP counts on that dataset that should not be judged from seed 1 alone (Figure 5).

5. Discussion

5.1. Interpretation of Results

This study assessed the effect of multi-stage hybrid feature selection on input dimensionality, detection, and resource use with an SSAE–Attention classifier. The importance rankings from XGBoost and ElasticNet reflect nonlinear feature interactions and regularized linear effects from different perspectives. MI then reassesses the intersection, and a separate PI assessment in each model yields the final intersection. The SSAE learns a sparse latent representation from the reduced input, and attention weights its dimensions. Our evaluation concerns the complete selection procedure and the measured trade-offs after reduction.
The originally selected features reduced the input from 78 to 22 on each dataset, a 71.8% reduction (Table 3 and Table 4). With the classifier, split, and preprocessing fixed, the ten-seed mean F1 for the proposed 22-feature set was 0.9434 on CIC-IDS2017 and 0.7942 on CSE-CIC-IDS2018. These values fell between those for XGBoost-22 (0.9285 and 0.7805) and ElasticNet-22 (0.9509 and 0.8012); neither paired difference with these single selectors was significant after Holm adjustment (Table 10). Relative to an independently configured MI∩Boruta-22 selector, the proposed set achieved a higher mean F1 on CSE-CIC-IDS2018 (0.7942 versus 0.4262; adjusted p = 0.0098), without a significant difference on CIC-IDS2017. Its value lies in substantial reduction with competitive detection under controlled comparison, not in consistently exceeding every individual selector.
Rerunning selection with fixed column order and tie handling produced final sets of 20 features on CIC-IDS2017 and 22 on CSE-CIC-IDS2018, sharing 16 and 18 features, respectively, with the original lists (Table 3). Stage-wise and component-ablation results on these rerun sets (Table 12) showed considerable reduction after PI, but the complete procedure did not attain the highest F1 among all removal variants. In particular, omitting MI did not lower mean F1. MI offers a model-independent reassessment criterion, but this ablation did not establish an independent detection gain from the MI stage. Seven and eight features, respectively, were selected in all ten stratified training subsamples, and twelve per dataset were selected in at least eight (Table 5). The recurring core and variable boundary features should therefore be distinguished when assessing selection stability.
After retraining Full-78 and the originally selected Final-22 on corrected preprocessing, the mean F1 on CIC-IDS2017 fell from 0.9617 to 0.9434 (paired mean difference: −0.0183; Holm-adjusted p = 0.0098). Mean FAR rose from 0.012377 to 0.014193 and mean FP count from 5627 to 6452. On CSE-CIC-IDS2018, mean F1 changed from 0.8007 to 0.7942 without a significant difference (paired mean difference: −0.0065; adjusted p = 1.0000). Mean FAR and FP declined from 0.012824 to 0.010232 and from 28,945 to 23,096, while mean recall fell from 0.6893 to 0.6750 (Table 13). The significant F1 loss on CIC-IDS2017 and the differing false-alarm and missed-attack patterns both matter for interpretation.
On CSE-CIC-IDS2018, the loss of recall with Final-22 was concentrated in Bot. Bot was absent from the training files, and none of its 286,191 test cases were detected in any of the ten training seeds. Yet DoS attacks–Hulk and DoS attacks–SlowHTTPTest, also absent from training, attained mean recalls of 0.9955 and 1.0000 (Table 17). Absence from training alone therefore does not explain detection behavior; the possible contribution of Bot traffic characteristics cannot be isolated here. In the supplementary 15-class CIC-IDS2017 evaluation, weighted F1 was maintained but macro F1 and Bot recall decreased (Supplementary Table S6). Aggregate binary metrics must be interpreted alongside attack-type results.
With the same Final-22 features, SSAE–Attention exceeded SSAE in mean F1 by 0.0042 on CIC-IDS2017 and 0.0076 on CSE-CIC-IDS2018, but neither difference was significant (adjusted p = 0.6250 and 1.0000). Its average FAR was lower on both datasets, with substantial seed variability on the 2018 data (Table 10 and Table 14). Adding attention increased the parameter count by 2112, from 27,560 to 29,672 and the 2018 training time from 417.72 to 460.66 s (Table 16). Attention is therefore a configuration choice to be weighed against its added cost and the observed FAR trend, rather than an indispensable component with established F1 gain.
With input reduction, the SSAE–Attention parameter count declined from 44,064 to 29,672 (32.7%). End-of-run process memory on the same CPU system fell from 1846.7 to 1170.7 MiB (36.6%) on CIC-IDS2017 and from 6624.8 to 3161.7 MiB (52.3%) on CSE-CIC-IDS2018. Training time decreased from 82.89 to 79.54 s and from 497.34 to 460.66 s, respectively. By contrast, forward-only time per sample, measured over the full test set, changed from 0.230 to 0.215 μs and from 0.452 to 0.455 μs; inference acceleration was not established beyond repeat variability (Table 15 and Table 16). The process-memory difference reflects reduced resident input matrices more than the small parameter arrays. Stage-wise offline selection costs should also be considered (Supplementary Tables S8 and S9).
Features repeatedly selected across subsamples relate to traffic volume, packet length, inter-arrival time, TCP connection behavior, and destination services (Table 5; Supplementary Table S7). The forward initial window bytes feature (Init Fwd Win Byts), repeatedly selected on both datasets, also received a high Composite MI score in the CSE-CIC-IDS2018 analysis by Mchina et al. [36]. Agreement across selectors supports informativeness within that dataset, but selection frequency does not establish a causal role. Initial window size and destination port may also reflect data-generation conditions such as tools, operating systems, and targeted services. The transferability of the specific feature lists to other networks remains to be tested.

5.2. Limitations and Future Work

The scope of these findings is bounded by the dataset construction, selection settings, and measurement environment.
The same selection procedure and retention ratios were applied separately to two public datasets with different capture conditions, CIC-IDS2017 and CSE-CIC-IDS2018. Neither further datasets nor cross-domain transfer of the selected features were evaluated. Reproduction of the selection procedure and recurring feature core on traffic with different definitions remains to be examined. The retention-ratio sensitivity analysis varied one ratio at a time in single-seed validation and does not establish an optimum (Table 11).
Under the stratified random 80/20 split of CIC-IDS2017, similar traffic patterns may be present on both sides of the partition. Duplicate records were not removed from either dataset. The CSE-CIC-IDS2018 holdout keeps all three Friday files in the fixed test set, preventing traffic from the same capture file from occurring in both partitions, but it is not a strict chronological train-to-future split (Section 4.1.1). Evaluation after deduplication and under explicitly temporal or multi-scenario splits remains necessary.
The feature-selection comparisons held the classifier, split, and preprocessing fixed to examine selector effects. Consequently, values from recent hybrid or deep models under different experimental conditions were not ranked, and traditional classifiers using the same 22 selected features were not evaluated. Conclusions about architecture are limited to the tested SAE–Attention, SSAE, and SSAE–Attention variants. Reimplementing recent methods under a shared protocol and applying the selected features to additional classifiers are directions for future work.
On CSE-CIC-IDS2018, ElasticNet issued convergence warnings at the max_iter = 5000 setting used in this study. Relevant fits were rerun with a cumulative limit up to 50,000; their rankings and final selected sets did not change, but convergence was not verified (Section 4.2.1). The 2018 stability, sensitivity, and ablation results therefore should not be interpreted as stability of a converged optimum. Other solvers and convergence conditions warrant separate examination.
The primary binary task distinguishes benign traffic from attacks but cannot show all attack-type differences in aggregate metrics. Final-22 Bot recall on CSE-CIC-IDS2018 was zero in all ten seeds, and recall for Brute Force-Web, Brute Force-XSS, and SQL Injection, which were present in training, was also low (Table 17). The supplementary CIC-IDS2017 multiclass analysis showed reductions in Bot recall and macro F1 (Supplementary Table S6). The absence of Bot from training and properties of its traffic may both contribute to the 2018 result, but their effects were not separated. Because some attack types were absent from training, the 2018 per-type results are recalls from a binary detector, not classwise metrics from a multiclass classifier.
Efficiency was measured as a relative comparison on one desktop-class CPU (Section 4.1.2). Offline feature-selection cost is distinct from online forward-only time, which excludes data loading, postprocessing, and latency of individual requests. Latency, throughput, and peak memory were not measured on GPUs, edge devices, or IoT security gateways; applicability to real-time or resource-constrained deployment remains to be evaluated in those environments.

6. Conclusions

We applied a multi-stage hybrid feature-selection procedure—intersection of XGBoost and ElasticNet importance rankings, MI reassessment, and separate PI assessments followed by a final intersection—to SSAE–Attention-based binary intrusion detection. The originally selected sets reduced the input from 78 to 22 features (71.8%) on both CIC-IDS2017 and CSE-CIC-IDS2018. Over ten training seeds with corrected preprocessing, the mean F1 on CIC-IDS2017 decreased significantly from 0.9617 (Full-78) to 0.9434 (Final-22; paired mean difference: −0.0183, Holm-adjusted p = 0.0098). On CSE-CIC-IDS2018, F1 changed from 0.8007 to 0.7942 without a significant difference (paired mean difference: −0.0065, adjusted p = 1.0000). At equal dimensionality, the proposed-set F1 lay between those of XGBoost-22 and ElasticNet-22 and exceeded that of MI∩Boruta-22 on the 2018 data. Thus, substantial dimensionality reduction was obtained with quantified, dataset-dependent detection trade-offs.
The SSAE–Attention parameter count decreased by 32.7%, and the end-of-run process memory on the single CPU system fell by 36.6% on CIC-IDS2017 and 52.3% on CSE-CIC-IDS2018. Training time decreased, but a clear reduction in forward-only time was not observed. Attention did not significantly improve mean F1 over the no-attention SSAE, so its additional cost should be considered alongside the lower mean FAR trend. Recurrently selected features related to traffic volume, timing, packets, and connection behavior. Nonetheless, Bot failures on the 2018 data and the significant F1 loss on CIC-IDS2017 show why aggregate detection metrics alone cannot establish the benefits of feature reduction. The contribution is a measured relationship among dimensionality, detection performance, attack-type errors, and resource use under the two datasets and CPU conditions evaluated here; transfer to other networks and real-time deployment requires further validation.

Supplementary Materials

The following supporting information can be downloaded at https://www.mdpi.com/article/10.3390/app162311601/s1: Table S1: Configuration and results of the MI∩Boruta reference selector; Table S2: Performance of five representative feature sets from the subsample analysis; Table S3: Retention-ratio sensitivity: Selection sizes and validation performance; Table S4: Stage-wise reduction and component ablation: full metrics; Table S5: Multi-seed results of all compared feature sets: full metrics; Table S6: Supplementary multi-class results on CIC-IDS2017; Table S7: Selection frequency of each feature over ten stratified training subsamples; Table S8: Feature-selection cost per stage and 95% confidence intervals of the measured times; Table S9: Memory measurements: process memory at the end of a run, input matrix sizes, and separate repeated measurements; Table S10: Implementation settings of the feature selector, SSAE–Attention, and comparison variants.

Author Contributions

Conceptualization, N.K. and B.L.; methodology, N.K.; software, G.K., Y.A. and J.P.; validation, G.K., Y.A., J.P. and N.K.; formal analysis, N.K. and G.K.; investigation, G.K., Y.A. and J.P.; data curation, Y.A. and J.P.; writing—original draft preparation, N.K.; writing—review and editing, N.K. and B.L.; visualization, G.K. and J.P.; supervision, N.K. and B.L.; project administration, N.K. and B.L.; funding acquisition, B.L. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Institute of Information & Communications Technology Planning & Evaluation (IITP)-Innovative Human Resource Development for Local Intellectualization program grant funded by the Korean government (MSIT) (IITP-2026-RS-2022-00156334).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The CIC-IDS2017 and CSE-CIC-IDS2018 datasets used in this study are publicly available from the Canadian Institute for Cybersecurity. The implementation code is available from the corresponding author upon reasonable request.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Khraisat, A.; Gondal, I.; Vamplew, P.; Kamruzzaman, J. Survey of Intrusion Detection Systems: Techniques, Datasets and Challenges. Cybersecurity 2019, 2, 20. [Google Scholar] [CrossRef] [Scilit]
  2. Buczak, A.L.; Guven, E. A Survey of Data Mining and Machine Learning Methods for Cyber Security Intrusion Detection. IEEE Commun. Surv. Tutor. 2016, 18, 1153–1176. [Google Scholar] [CrossRef] [Scilit]
  3. Shone, N.; Ngoc, T.N.; Phai, V.D.; Shi, Q. A Deep Learning Approach to Network Intrusion Detection. IEEE Trans. Emerg. Top. Comput. Intell. 2018, 2, 41–50. [Google Scholar] [CrossRef] [Scilit]
  4. Sommer, R.; Paxson, V. Outside the Closed World: On Using Machine Learning for Network Intrusion Detection. In Proceedings of the 2010 IEEE Symposium on Security and Privacy, Oakland, CA, USA, 16–19 May 2010; pp. 305–316. [Google Scholar] [CrossRef] [Scilit]
  5. Ring, M.; Wunderlich, S.; Scheuring, D.; Landes, D.; Hotho, A. A Survey of Network-Based Intrusion Detection Data Sets. Comput. Secur. 2019, 86, 147–167. [Google Scholar] [CrossRef] [Scilit]
  6. Sarhan, M.; Layeghy, S.; Portmann, M. Evaluating Standard Feature Sets Towards Increased Generalisability and Explainability of ML-Based Network Intrusion Detection. Big Data Res. 2022, 30, 100359. [Google Scholar] [CrossRef] [Scilit]
  7. Mirsky, Y.; Doitshman, T.; Elovici, Y.; Shabtai, A. Kitsune: An Ensemble of Autoencoders for Online Network Intrusion Detection. In Proceedings of the Network and Distributed System Security Symposium (NDSS 2018), San Diego, CA, USA, 18–21 February 2018; Available online: https://arxiv.org/abs/1802.09089 (accessed on 19 September 2026).
  8. Guyon, I.; Elisseeff, A. An Introduction to Variable and Feature Selection. J. Mach. Learn. Res. 2003, 3, 1157–1182. Available online: https://www.jmlr.org/papers/v3/guyon03a.html (accessed on 19 September 2026). [CrossRef] [Scilit]
  9. Amiri, F.; Rezaei Yousefi, M.; Lucas, C.; Shakery, A.; Yazdani, N. Mutual Information-Based Feature Selection for Intrusion Detection Systems. J. Netw. Comput. Appl. 2011, 34, 1184–1199. [Google Scholar] [CrossRef] [Scilit]
  10. Chen, T.; Guestrin, C. XGBoost: A Scalable Tree Boosting System. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016; pp. 785–794. [Google Scholar] [CrossRef] [Scilit]
  11. Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef] [Scilit]
  12. Zou, H.; Hastie, T. Regularization and Variable Selection via the Elastic Net. J. R. Stat. Soc. Ser. B Stat. Methodol. 2005, 67, 301–320. [Google Scholar] [CrossRef] [Scilit]
  13. Peng, H.; Long, F.; Ding, C. Feature Selection Based on Mutual Information: Criteria of Max-Dependency, Max-Relevance, and Min-Redundancy. IEEE Trans. Pattern Anal. Mach. Intell. 2005, 27, 1226–1238. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  14. Altmann, A.; Toloşi, L.; Sander, O.; Lengauer, T. Permutation Importance: A Corrected Feature Importance Measure. Bioinformatics 2010, 26, 1340–1347. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  15. Jaw, E.; Wang, X. Feature Selection and Ensemble-Based Intrusion Detection System: An Efficient and Comprehensive Approach. Symmetry 2021, 13, 1764. [Google Scholar] [CrossRef] [Scilit]
  16. 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] [Scilit]
  17. Hinton, G.E.; Salakhutdinov, R.R. Reducing the Dimensionality of Data with Neural Networks. Science 2006, 313, 504–507. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  18. Vincent, P.; Larochelle, H.; Bengio, Y.; Manzagol, P.-A. Extracting and Composing Robust Features with Denoising Autoencoders. In Proceedings of the 25th International Conference on Machine Learning (ICML 2008), Helsinki, Finland, 5–9 July 2008; pp. 1096–1103. [Google Scholar] [CrossRef] [Scilit]
  19. Bahdanau, D.; Cho, K.; Bengio, Y. Neural Machine Translation by Jointly Learning to Align and Translate. arXiv 2014, arXiv:1409.0473. [Google Scholar] [CrossRef] [Scilit]
  20. Sharafaldin, I.; Lashkari, A.H.; Ghorbani, A.A. Toward Generating a New Intrusion Detection Dataset and Intrusion Traffic Characterization. In Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP 2018), Funchal, Portugal, 22–24 January 2018; pp. 108–116. [Google Scholar] [CrossRef] [Scilit]
  21. Alzughaibi, S.; El Khediri, S. A Cloud Intrusion Detection Systems Based on DNN Using Backpropagation and PSO on the CSE-CIC-IDS2018 Dataset. Appl. Sci. 2023, 13, 2276. [Google Scholar] [CrossRef] [Scilit]
  22. Vinayakumar, R.; Alazab, M.; Soman, K.P.; Poornachandran, P.; Al-Nemrat, A.; Venkatraman, S. Deep Learning Approach for Intelligent Intrusion Detection System. IEEE Access 2019, 7, 41525–41550. [Google Scholar] [CrossRef] [Scilit]
  23. Wang, Y.-C.; Houng, Y.-C.; Chen, H.-X.; Tseng, S.-M. Network Anomaly Intrusion Detection Based on Deep Learning Approach. Sensors 2023, 23, 2171. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  24. Yin, C.; Zhu, Y.; Fei, J.; He, X. A Deep Learning Approach for Intrusion Detection Using Recurrent Neural Networks. IEEE Access 2017, 5, 21954–21961. [Google Scholar] [CrossRef] [Scilit]
  25. Emane, C.R.D.; Lee, H.; Choi, D.; Lim, J.; Bok, K.; Yoo, J. An Abnormal Pattern Detection Scheme Based on GCN and DBSCAN in a Large-Scale Graph. Int. J. Contents 2022, 18, 1–9. [Google Scholar] [CrossRef] [Scilit]
  26. Hu, K.; Li, H. Simplified Graph Convolution Based Anomaly Detection for Multivariate Time Series. Int. J. Contents 2025, 21, 16–23. [Google Scholar] [CrossRef] [Scilit]
  27. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention Is All You Need. In Proceedings of the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA, 4–9 December 2017; pp. 5998–6008. [Google Scholar]
  28. Zouhri, H.; Idri, A.; Ratnani, A. Evaluating the Impact of Filter-Based Feature Selection in Intrusion Detection Systems. Int. J. Inf. Secur. 2024, 23, 759–785. [Google Scholar] [CrossRef] [Scilit]
  29. Khammassi, C.; Krichen, S. A GA-LR Wrapper Approach for Feature Selection in Network Intrusion Detection. Comput. Secur. 2017, 70, 255–277. [Google Scholar] [CrossRef] [Scilit]
  30. Lian, W.; Nie, G.; Jia, B.; Shi, D.; Fan, Q.; Liang, Y. An Intrusion Detection Method Based on Decision Tree-Recursive Feature Elimination in Ensemble Learning. Math. Probl. Eng. 2020, 2020, 2835023. [Google Scholar] [CrossRef] [Scilit]
  31. Salo, F.; Nassif, A.B.; Essex, A. Dimensionality Reduction with IG-PCA and Ensemble Classifier for Network Intrusion Detection. Comput. Netw. 2019, 148, 164–175. [Google Scholar] [CrossRef] [Scilit]
  32. Kavitha, C.; Saravanan, M.; Gadekallu, T.R.; Nimala, K.; Kavin, B.P.; Lai, W.-C. Filter-Based Ensemble Feature Selection and Deep Learning Model for Intrusion Detection in Cloud Computing. Electronics 2023, 12, 556. [Google Scholar] [CrossRef] [Scilit]
  33. Alsaffar, A.M.; Nouri-Baygi, M.; Zolbanin, H.M. Shielding Networks: Enhancing Intrusion Detection with Hybrid Feature Selection and Stack Ensemble Learning. J. Big Data 2024, 11, 133. [Google Scholar] [CrossRef] [Scilit]
  34. Mhawi, D.N.; Aldallal, A.; Hassan, S. Advanced Feature-Selection-Based Hybrid Ensemble Learning Algorithms for Network Intrusion Detection Systems. Symmetry 2022, 14, 1461. [Google Scholar] [CrossRef] [Scilit]
  35. Wang, Z.; Liu, J.; Sun, L. EFS-DNN: An Ensemble Feature Selection-Based Deep Learning Approach to Network Intrusion Detection System. Secur. Commun. Netw. 2022, 2022, 2693948. [Google Scholar] [CrossRef] [Scilit]
  36. Mchina, J.P.; Mduma, N.; Sinde, R.S. Adaptive Class-Aware Feature Selection for High-Dimensional and Imbalanced Multi-Class Network Intrusion Detection. Front. Big Data 2026, 9, 1871346. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  37. Bilal, A.; Sharif, K.; Zhu, L.; Li, F.; Xu, C.; Karim, M.M. Evaluation to Integration: Hybrid Feature Selection Framework With Ensemble Machine Learning for Intrusion Detection. IEEE Trans. Dependable Secur. Comput. 2026, 23, 6362–6377. [Google Scholar] [CrossRef] [Scilit]
  38. Yuan, M.; Yang, K. Deep Learning Network Intrusion Detection Based on MI-XGBoost Feature Selection. J. Cyber Secur. 2025, 7, 197–219. [Google Scholar] [CrossRef] [Scilit]
  39. Varanasi, V.R.; Shaik, R. An Enhanced Intrusion Detection System Using Attention-Based Stacked Sparse Autoencoder Feature Extraction. Eng. Technol. Appl. Sci. Res. 2025, 15, 24436–24441. [Google Scholar] [CrossRef] [Scilit]
  40. Ahmed, U.; Muhammad, S.; Choi, J. Explainable Intrusion and Anomaly Detection for IoT Sensor Networks Using Hybrid Feature Selection and Deep Autoencoder Learning. Sensors 2026, 26, 4540. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  41. Lee, S.-W.; Sidqi, H.M.; Mohammadi, M.; Rashidi, S.; Rahmani, A.M.; Masdari, M.; Hosseinzadeh, M. Towards Secure Intrusion Detection Systems Using Deep Learning Techniques: Comprehensive Analysis and Review. J. Netw. Comput. Appl. 2021, 187, 103111. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.