Skip to Content
AIAI
  • Article
  • Open Access

25 January 2026

31 Pages

A Hybrid Intrusion Detection Framework Using Deep Autoencoder and Machine Learning Models

and
Faculty of Informatics and Electrical Engineering, Department of Electrical Engineering and Infocommunications, Széchenyi István University of Győr, Egyetem tér 1, 9026 Győr, Hungary
*
Author to whom correspondence should be addressed.

Abstract

This study provides a detailed comparative analysis of a three-hybrid intrusion detection method aimed at strengthening network security through precise and adaptive threat identification. The proposed framework integrates an Autoencoder-Gaussian Mixture Model (AE-GMM) with two supervised learning techniques, XGBoost and Logistic Regression, combining deep feature extraction with interpretability and stable generalization. Although the downstream classifiers are trained in a supervised manner, the hybrid intrusion detection nature of the framework is preserved through unsupervised representation learning and probabilistic modeling in the AE-GMM stage. Two benchmark datasets were used for evaluation: NSL-KDD, representing traditional network behavior, and UNSW-NB15, reflecting modern and diverse traffic patterns. A consistent preprocessing pipeline was applied, including normalization, feature selection, and dimensionality reduction, to ensure fair comparison and efficient training. The experimental findings show that hybridizing deep learning with gradient-boosted and linear classifiers markedly enhances detection performance and resilience. The AE–GMM-XGBoost model achieved superior outcomes, reaching an F1-score above 0.94 ± 0.0021 and an AUC greater than 0.97 on both datasets, demonstrating high accuracy in distinguishing legitimate and malicious traffic. AE-GMM-Logistic Regression also achieved strong and balanced performance, recording an F1-score exceeding 0.91 ± 0.0020 with stable generalization across test conditions. Conversely, the standalone AE-GMM effectively captured deep latent patterns but exhibited lower recall, indicating limited sensitivity to subtle or emerging attacks. These results collectively confirm that integrating autoencoder-based representation learning with advanced supervised models significantly improves intrusion detection in complex network settings. The proposed framework therefore provides a solid and extensible basis for future research in explainable and federated intrusion detection, supporting the development of adaptive and proactive cybersecurity defenses.

1. Introduction

Intrusion detection has become a core requirement in modern network security as contemporary infrastructures generate massive, heterogeneous traffic and face increasingly adaptive attack strategies that often bypass traditional signature-based defenses [1]. Traditional rule and signature-based intrusion detection systems are inherently limited because they rely on predefined patterns and static rules that cannot adapt to previously unseen or evolving attack behaviors. In practice, adversaries frequently employ techniques such as payload obfuscation, protocol mimicry, polymorphism, and low-and-slow attack strategies, which significantly reduce the effectiveness of fixed signatures.
Furthermore, encrypted traffic and the growing heterogeneity of modern network environments obscure discriminative features, while high-dimensional traffic representations increase feature-space overlap between normal and malicious behavior, leading to higher false negatives and delayed detection. Recent empirical and survey-based studies emphasize that rule-driven IDS frameworks are frequently brittle under evolving threat patterns, which has accelerated the shift toward data-driven approaches capable of learning from traffic behavior rather than relying on static signatures [2]. This need is particularly evident in large-scale and high-variability environments, such as telecom and IoT ecosystems, where normal traffic exhibits substantial variability and attack traces may appear subtle or short-lived [3]. Consequently, intrusion-oriented IDS paradigms have gained prominence because they aim to detect deviations from learned normal behavior and offer a pathway to identifying previously unseen intrusions in operational settings [1,2].
Autoencoders have been widely adopted in intrusion detection due to their ability to learn compact latent representations that capture the underlying structure of normal network traffic without requiring labeled attack data [4]. By minimizing reconstruction error, AE-based models can effectively model regular traffic patterns and flag deviations as potential anomalies, which makes them attractive for security scenarios where labeled data are scarce or incomplete. However, recent analytical studies highlight that standalone autoencoder-based detectors often exhibit limited sensitivity to subtle or evolving attacks, particularly in highly imbalanced intrusion datasets where anomalous samples may partially overlap with normal behavior in the feature space [4]. This limitation is further exacerbated in real-world and streaming environments, where traffic distributions evolve over time and reconstruction-based thresholds may become overly conservative, leading to reduced recall [5]. These findings suggest that while autoencoders provide a strong foundation for representation learning, their effectiveness as isolated intrusion detectors remains constrained in complex and dynamic network settings.
Building upon the limitations of purely unsupervised detectors, recent intrusion detection research increasingly favors hybrid frameworks that integrate deep representation learning with supervised or semi-supervised classifiers to enhance detection robustness and decision boundaries [6,7,8,9]. Hybrid IDS architectures leverage deep models to extract informative latent features from high-dimensional traffic data, while downstream classifiers exploit labeled information to improve class separability and reduce false negatives. Empirical evaluations in IoT and industrial network contexts demonstrate that such hybrid designs consistently outperform single-model approaches in both binary and multi-class intrusion detection scenarios, particularly under complex and noisy traffic conditions [6,7]. Moreover, staged or layered hybrid detection strategies have been shown to improve generalization across heterogeneous attack types by combining intrusion awareness with discriminative learning [8,9].
Recent IDS studies have demonstrated that ensemble classifiers combined with statistical feature selection can achieve strong detection performance on benchmark datasets. Nevertheless, these approaches rely on direct learning from raw preprocessed traffic features and do not model latent representations of network behavior. This motivates the integration of anomaly-aware latent representation learning prior to supervised classification to enhance detection robustness [10].
These findings collectively motivate the adoption of hybrid intrusion detection frameworks as a practical compromise between representation power, detection accuracy, and operational reliability in modern IDS deployments.
In practical deployment scenarios, intrusion detection systems must operate on complex data streams that include multivariate time series and large-scale system logs, where temporal dependencies and cross-feature correlations play a critical role in distinguishing normal from malicious behavior [11,12]. Recent studies on log-based and time series intrusion detection emphasize that attack patterns are often context-dependent and may manifest as subtle temporal inconsistencies rather than abrupt deviations in individual features [11]. This complexity poses additional challenges for traditional IDS models, as static feature representations or single-shot classification may fail to capture evolving attack dynamics. Survey-based analyses further highlight that effective IDS solutions must balance expressive feature modeling with robustness to noise, concept drift, and incomplete labeling, particularly in continuously generated traffic streams [12]. These observations reinforce the need for detection frameworks that can exploit learned latent representations while remaining adaptable to temporal variability and real-world operational constraints.
Robust evaluation remains a critical requirement for validating intrusion detection frameworks under realistic and diverse threat conditions. Benchmark datasets such as NSL-KDD and UNSW-NB15 continue to be widely employed because they provide complementary views of legacy and modern network attack behaviors, enabling systematic comparison with prior studies while assessing generalization across heterogeneous traffic patterns [13,14]. Recent IDS research also explores advanced paradigms, including software-defined networking and language-model-based detectors, to address unseen or rapidly evolving attacks; however, such approaches often introduce substantial computational and architectural complexity that may limit their practical deployment in resource-constrained environments [15]. These considerations underscore the importance of designing intrusion detection frameworks that balance detection accuracy, robustness, and operational feasibility. In this context, the present study positions itself within the broader IDS literature by systematically evaluating a hybrid intrusion detection framework on established benchmark datasets, aiming to provide a pragmatic and reproducible solution that bridges unsupervised representation learning and supervised decision-making without incurring excessive model complexity.

1.1. Motivation

The increasing complexity and volume of network traffic have rendered traditional signature-based intrusion detection systems inadequate for detecting evolving and previously unseen attacks. A hybrid intrusion detection offers a promising alternative by modeling normal network behavior; however, purely unsupervised approaches often suffer from limited discriminative capability when benign and malicious traffic patterns overlap. Autoencoders have demonstrated effectiveness in learning compact latent representations from high-dimensional traffic data, enabling meaningful feature extraction without manual engineering. Nevertheless, reconstruction-based detection alone is frequently insufficient for robust decision-making in realistic intrusion scenarios. This motivates the development of hybrid frameworks that combine deep representation learning with probabilistic modeling and supervised classifiers, aiming to enhance detection accuracy while maintaining practical deployability and interpretability.

1.2. Contribution

This study proposes a hybrid intrusion detection framework that separates intrusion detection representation learning from supervised decision-making. An Autoencoder-Gaussian Mixture Model is employed to learn latent and probabilistic characteristics of normal traffic, while XGBoost and Logistic Regression are applied as downstream classifiers using the same intrusion-informed feature space. This design enables a controlled comparison between unsupervised, ensemble-based, and interpretable linear detection strategies under identical preprocessing conditions.
Unlike many existing hybrid IDS studies that primarily focus on performance improvement through model stacking, this work emphasizes methodological consistency by evaluating all models on the same latent feature space and explicitly analyzing the trade-off between detection accuracy and interpretability.
The experimental results on NSL-KDD and UNSW-NB15 demonstrate that supervised models built on intrusion-driven representations significantly improve detection performance compared to a standalone AE-GMM. The framework therefore provides reproducible and practically relevant insight into hybrid intrusion detection design.

1.3. Paper Layout

The remainder of this paper is organized as follows: Section 2 reviews the related work. Section 3 details the methodology adopted in this study. Section 4 describes the model architecture and mathematical formulation. Section 5 presents the experimental results and discussion. Section 6 concludes this paper and outlines directions for future research. Appendix A includes implementation details and hyperparameter configuration. Reference section lists the references cited throughout the manuscript.

3. Methodology

Figure 1 illustrates the workflow of the proposed hybrid intrusion detection framework. The process begins with data exploration, cleaning, and feature engineering to eliminate missing, duplicated, and highly correlated features. The models are AE-GMM, AE-GMM-XGBoost, as a supervised classifier, and AE-GMM-Logistic Regression as an interpretable benchmark. Model performance is subsequently evaluated using standard metrics, and the optimized version is stored for future deployment in real-network environments.
Figure 1. The workflow of the proposed intrusion detection model.

3.1. Dataset

In the current study, we use two publicly available datasets, NSL-KDD [14] and UNSW-NB15 [13], to evaluate the proposed hybrid framework. The data undergo cleaning, feature engineering, and preprocessing steps prior to model training.

3.1.1. UNSW-NB15 Dataset

The UNSW-NB15 dataset was created at the Australian Centre for Cyber Security in 2015 to provide a realistic environment for studying modern cyberattacks. Unlike the older KDD datasets, which no longer reflect current network behaviors, UNSW-NB15 captures both normal and malicious traffic in a controlled setting. It contains data generated from real-network activities mixed with simulated attacks, making it a valuable resource for testing intrusion detection algorithms. In this work, we use the cleaned version that includes 175,341 samples for training and 82,332 for testing. The dataset originally contains 47 features covering network flow, content, and timing information. Each record is labeled as either normal or one of ten attack types, such as DoS, exploits, or reconnaissance. This diversity and structure make UNSW-NB15 a practical and modern benchmark for intrusion detection studies [13].

3.1.2. NSL-KDD Dataset

The NSL-KDD dataset was introduced as an improved version of the classic KDD’99 benchmark to reduce redundancy and bias in training. It remains widely used for evaluating intrusion detection models because of its clean and well-balanced structure. NSL-KDD includes 125,973 training records and 22,544 testing records, originally described by 41 numerical, categorical, and binary features. The dataset groups attacks into four major types—Denial of Service (DoS), Probe, Remote to Local (R2L), and User to Root (U2R)—along with normal traffic. These categories reflect different patterns of malicious behavior that challenge detection models in different ways. Due to its manageable size and balanced design, NSL-KDD continues to serve as a key reference for testing both traditional and deep learning-based approaches [14].
Table 1 presents the class distribution and the number of samples used for training and testing in the UNSW-NB15 and NSL-KDD datasets.
Table 1. Datasets.
To avoid ambiguity regarding dataset characteristics, it should be noted that all sample counts and feature dimensions reported in this section refer to the final processed datasets used in the experiments. While the original versions of NSL-KDD and UNSW-NB15 contain a larger number of raw attributes, categorical encoding, normalization, and low-variance feature filtering were applied prior to model training. As a result, a consistent feature space was maintained across all experiments and models. The same processed datasets and feature sets were used throughout training and evaluation to ensure consistency and comparability of the reported results.
Table 2 summarizes the key characteristics of the NSL-KDD and UNSW-NB15 datasets before and after preprocessing. The reported sample sizes and feature descriptions correspond to the final processed datasets used in all experiments.
Table 2. Dataset characteristics before and after preprocessing.
As part of this analysis, we focused initially on the protocol type feature, which categorizes the type of protocol used in each network connection. As illustrated in Figure 2, this feature contains only three distinct values representing the most common internet protocols. Table 3 presents a quantitative summary of the distribution of these protocol types. These datasets were used consistently across all three models (AE-GMM, AE-GMM -XGBoost, and AE-GMM-Logistic Regression) to ensure fair and reproducible evaluation.
Figure 2. Distribution of network traffic according to protocol categories (TCP, UDP, and ICMP).
Table 3. Summary of the datasets used in this study.
Such visualization aids in identifying imbalances and patterns in the dataset, which is essential for designing an effective intrusion detection model.
It should be noted that the feature counts reported across different tables correspond to distinct representation stages. The original datasets include a higher number of raw attributes, while the feature counts reported in Table 3 reflect the effective input representations after categorical encoding and preprocessing, prior to latent space transformation by the autoencoder. This distinction explains the minor differences in reported feature numbers and does not compromise the integrity, consistency, or validity of the experimental pipeline.
Table 4 summarizes the frequency distribution of network service types contained in the NSL-KDD dataset. HTTP and private services dominate the dataset, representing 34.83% and 21.17% of the total traffic, respectively. This reflects the prominence of web-based and internal communication activities in real-world network environments. Services such as Telnet, POP3, SMTP, and FTP are also present, capturing remote access and email-related transactions that are commonly exploited in intrusion scenarios.
Table 4. Distribution of network service types in the NSL-KDD dataset.
The variety of service types enhances the dataset’s representativeness and allows for comprehensive evaluation of detection models across diverse communication channels. The high proportion of HTTP and private services provides rich data for learning normal traffic behaviors, while the inclusion of low-frequency services, such as ECO_I and FTP, introduces challenges in identifying rare attack patterns, thereby testing the adaptability and sensitivity of the intrusion detection models.
Table 5 presents the percentage distribution of network protocol types in the UNSW-NB15 dataset. As observed, TCP and UDP dominate the dataset with 52.34% and 35.73%, respectively, representing the most common transport protocols used in real-world internet traffic. Protocols such as ARP, OSPF, and SCTP appear in smaller proportions, corresponding to routing, address resolution, and specialized data exchange functions. The presence of multiple protocol types contributes to the dataset’s heterogeneity and enhances its suitability for evaluating intrusion detection models.
Table 5. Distribution of network protocol types in the UNSW-NB15 dataset.
This distribution also influences model performance, as the high concentration of TCP and UDP traffic provides abundant patterns for training, while the limited samples from rare protocols such as GRE or UNAS test the model’s ability to detect less frequent but potentially critical anomalies.

3.2. Data Preprocessing

The data preprocessing stage represents a crucial foundation for achieving reliable and reproducible results across the three evaluated models: the Autoencoder-Gaussian Mixture Model (AE-GMM), AE-GMM-XGBoost, and AE-GMM-Logistic Regression. A unified preprocessing pipeline was designed and implemented to ensure consistency and comparability between experiments. The procedure began with data cleaning, where duplicate and incomplete records were removed, and noisy samples were filtered out to enhance dataset integrity and prevent bias during training [31].
Noise definition and filtering criteria: In this study, noisy samples refer to records that may negatively affect model training due to data-quality issues rather than representative network behavior. Specifically, the preprocessing stage targeted duplicated entries, samples containing missing or invalid values (such as undefined or non-numeric fields after encoding), and records exhibiting clear inconsistencies identified during data integrity checks. These filtering operations were applied uniformly to both the NSL-KDD and UNSW-NB15 datasets prior to model training. Importantly, the noise removal process focused on eliminating data artifacts while preserving the original traffic characteristics and class distribution. All subsequent experiments were conducted using the cleaned datasets, and the final sample counts reported in Table 1 and Table 2 correspond to the datasets after preprocessing.
Redundant and highly correlated features were examined through a correlation matrix, and those exceeding the predefined threshold were eliminated to avoid multicollinearity, which can degrade model interpretability and convergence, especially in AE-GMM-Logistic Regression.
Next, categorical features such as protocol_type, service, and flag were transformed into numerical representations using a combination of label encoding and one-hot encoding techniques. This conversion ensured full compatibility with both tree-based models (AE-GMM-XGBoost) and density-based learning architectures (AE-GMM) [32]. For numerical attributes, Min-Max normalization was applied to scale the feature values to a range between 0 and 1. This standardization step stabilized gradient optimization in AE-GMM and balanced the influence of large-magnitude features, which is particularly critical in linear models like AE-GMM-Logistic Regression [33].
Following normalization, feature selection was performed using a correlation-based filtering approach to retain the most informative and discriminative attributes for intrusion detection.
All preprocessing operations were executed using Python (version 3.13.5, Anaconda distribution), with Pandas (version 2.2.3), NumPy (version 2.3.3), and Scikit-learn (version 1.6.1), ensuring reproducibility and transparency of the experimental pipeline. This unified pipeline provided a clean, standardized, and scalable data foundation that enabled the fair comparison of the three models. Recent studies have emphasized that rigorous preprocessing, especially normalization, encoding, and feature reduction, significantly enhances model generalization and interpretability in network intrusion detection frameworks [31,32,33].

3.3. Feature Selection and Integration Process

The feature selection and integration process played a crucial role in ensuring the reliability and consistency of the three models: Autoencoder-Gaussian Mixture Model (AE-GMM), AE-GMM-XGBoost, and AE-GMM-Logistic Regression. Since the datasets (NSL-KDD and UNSW-NB15) contain a mix of categorical and numerical attributes, an initial normalization step was performed using the Min-Max scaling technique to transform each feature into a standardized range between 0 and 1, as shown in Equation (1).
x s c a l e d = x − x m i n x m a x − x m i n
This normalization ensured that all features contributed equally during model training and prevented bias toward attributes with larger numerical ranges. The scaling parameters were computed exclusively on the training data and subsequently applied to the test set to prevent information leakage.
Following the normalization step, redundant and low-variance attributes were removed to reduce noise and improve computational efficiency.
For the AE-GMM, all preprocessed features were passed through the encoder to learn compact latent representations that preserved the most discriminative characteristics of the traffic data. This stage helped the GMM component to better distinguish between normal and anomalous instances by modeling latent-space clusters with probabilistic density estimation.
To ensure a controlled comparison across models, feature filtering was performed using model-agnostic criteria, including low-variance removal and correlation-based filtering. The same processed feature set was used as input for both XGBoost and Logistic Regression classifiers. XGBoost feature importance scores were computed solely for interpretability purposes and were not used to define the feature subset for the Logistic Regression model.
In the AE-GMM-XGBoost model, the feature importance scores were computed using the gradient-based gain metric, as expressed in Equation (2) [34]
F I f i = 1 T ∑ t = 1 T ∑ n ∈ N t ( f i ) G a i n ( n )
where T denotes the total number of trees in the ensemble, N t ( f i ) represents the set of nodes in tree t where feature f i is used for splitting, and Gain (n) denotes the reduction in the objective function achieved by split node n.
Features with higher gain values were prioritized, allowing the model to automatically identify the most relevant predictors of network intrusions. This embedded selection process significantly enhanced interpretability and reduced dimensional complexity, as supported by recent works emphasizing multi-objective feature optimization for intrusion detection systems [35].
For the AE-GMM-Logistic Regression model, the integration process involved using the same processed feature set obtained from the model-agnostic filtering stage to ensure comparability across models. The model’s coefficients served as additional interpretability indicators, quantifying the influence of each feature on classification outcomes. This consistent feature integration pipeline ensured fair evaluation and facilitated the comparison of deep learning, ensemble, and linear techniques under identical preprocessing conditions [36].
Collectively, the combination of normalization, dimensionality reduction, and embedded importance estimation provided a balanced framework that enhanced model accuracy and robustness across both datasets, establishing a unified basis for the comparative analysis.

4. Model Architecture and Mathematical Formulation

The architecture of the proposed intrusion detection framework integrates three learning paradigms, Autoencoder-Gaussian Mixture Model (AE-GMM), AE-GMM-XGBoost, and AE-GMM-Logistic Regression, to balance deep representation learning, ensemble inference, and statistical interpretability.
In the AE-GMM, the autoencoder learns to reconstruct network traffic samples x i by minimizing the mean squared error between the input and its reconstruction x ^ i . In Equation (3), showing the loss function, ref. [37] is expressed as
M S E = 1 n m ∑ i = 1 n m ( x i − x ^ i ) 2
where n m denotes the number of training samples.
This stage ensures that the latent representations z i encode the underlying statistical regularities of normal traffic.
Subsequently, the latent embeddings are modeled with a Gaussian Mixture Model (GMM) to estimate the data density. According to Equation (4), ref. [38], the likelihood of a sample is
p z = ∑ k = 1 K π k N z | μ k , ∧ k − 1
where K denotes the number of Gaussian components, π k are the mixing coefficients satisfying ∑ k = 1 K π k = 1 , and N ( ⋅ ) is the multivariate normal density with the mean vector μ k and precision matrix ∧ k (thus ∑ k = ∧ k − 1 is the covariance matrix of component k ). Samples associated with low likelihood (i.e., high negative log-likelihood) are flagged as anomalies.
For the AE-GMM-XGBoost classifier, latent or engineered features are fed into an ensemble of boosted trees that optimize a regularized objective function adapted from [34], as shown in Equation (5)
O b j e c t i v e = ∑ i = 1 n L y i , y ^ i + ∑ t = 1 T Ω ( f t )
where y i denotes the ground-truth label of instance i, y ^ i is the predicted output, T is the total number of trees in the ensemble, and each f t represents t-th regression tree.
L is the differentiable loss (e.g., logistic loss), and the regularization term Ω
Ω f = γ J + 1 2 λ ∑ j = 1 J w j 2
where J denotes the number of leaf nodes in a tree, w j is the weight of leaf j, and γ and λ are regularization parameters controlling model complexity.
This formulation prevents overfitting while enabling AE-GMM-XGBoost to model nonlinear interactions efficiently and consistent with the training process in the proposed model, which achieved high precision and AUC on both NSL-KDD and UNSW-NB15 datasets.
Finally, the AE-GMM-Logistic Regression layer acts as a lightweight linear classifier that estimates the probability of an instance being anomalous or normal. Based on [24], Equation (7) shows the predictive probability:
p γ = 1 X = x = 1 1 + e − ( β 0 + β 1 x 1 + β 2 x 2 + … + β p x p )
This formulation provides an interpretable probabilistic mapping from input features to class membership, facilitating transparent decision boundaries in security auditing contexts.
Together, these formulations define a cohesive pipeline where the AE–GMM captures complex distributions in network traffic, AE-GMM-XGBoost refines detection through supervised learning, and AE-GMM-Logistic Regression provides explainability and benchmarking. This layered approach reflects the actual implementation of the system and adheres to established methodologies in recent research.
-
Implementation Details and Hyperparameter Settings
The autoencoder architecture employed in this study follows a fully connected symmetric design tailored for network traffic representation learning. The encoder consists of successive dense layers that progressively reduce the input feature space to a low-dimensional latent representation, while the decoder mirrors this structure to reconstruct the original input. Rectified Linear Unit (ReLU) activations are used in the hidden layers to introduce nonlinearity, and the model is trained using the mean squared reconstruction error as the optimization objective. Training is performed using the Adam optimizer with a fixed learning rate, and early stopping is applied to prevent overfitting.
The latent representations learned by the autoencoder are subsequently modeled using a Gaussian Mixture Model (GMM) to estimate the probability density of normal traffic patterns. The number of mixture components is selected empirically to balance model expressiveness and computational efficiency, and the Expectation-Maximization algorithm is used for parameter estimation. The resulting likelihood scores provide an intrusion-aware representation that captures both reconstruction behavior and latent distribution characteristics.
For supervised classification, Extreme Gradient Boosting (XGBoost) and Logistic Regression are employed as downstream classifiers. XGBoost is configured with a limited tree depth, a moderate learning rate, and subsampling to mitigate overfitting and handle class imbalance effectively. Logistic Regression is used as a linear baseline to provide interpretability and stable decision boundaries. Both classifiers are trained exclusively on the latent features derived from the AE-GMM module.
Feature selection is applied prior to model training to reduce redundancy and improve computational efficiency. Low-variance features are removed after normalization, and the same feature subset is consistently used across all models to ensure a fair comparison.
These implementation choices are directly derived from the experimental codebase and are designed to ensure reproducibility and robustness across datasets. A concise summary of the architectural design, probabilistic modeling configuration, classifier settings, and preprocessing procedures is provided in Appendix A (Table A1, Table A2, Table A3, Table A4 and Table A5).

4.1. Autoencoder-Gaussian Mixture Model

The proposed framework integrates an autoencoder (AE) with a Gaussian Mixture Model (GMM) to perform unsupervised intrusion detection. The autoencoder is designed to learn compressed latent representations of normal network traffic by minimizing reconstruction loss during training. It consists of symmetrical encoder and decoder layers, where the encoder transforms input data into a lower-dimensional latent space and the decoder reconstructs it to approximate the original feature vector. During training, only normal traffic samples from the NSL-KDD and UNSW-NB15 datasets were used to accurately capture normal behavioral patterns.
After training, the reconstruction error for each sample was computed, reflecting how well the AE could reproduce the input. The GMM was then fitted on the latent representations of the normal data to estimate their probability distribution. This probabilistic modeling enables distinguishing between normal and abnormal data points by evaluating the energy score of each observation.
Threshold selection. The decision threshold was set at the 95th percentile of the anomaly energy distribution computed on the training data, following common practice in the intrusion detection literature. This percentile-based threshold provides a pragmatic balance between sensitivity and false alarm control when explicit labels for anomalous behavior are limited. Lower percentile values (e.g., 90%) typically increase sensitivity but may lead to a higher false positive rate, whereas higher percentiles (e.g., 97.5% or 99%) enforce more conservative decision boundaries that reduce false alarms at the expense of increased false negatives. During preliminary analysis, alternative percentile values were considered, and the 95th percentile consistently provided the most stable trade-off between detection coverage and false alarm rate across both datasets. This threshold was selected after sensitivity analysis on validation folds to ensure robustness across different data distributions.
This approach effectively identifies deviations in traffic patterns without requiring labeled data, offering a balance between reconstruction-based and density-based intrusion detection. Similar Autoencoder-GMM hybrids have proven robust in industrial and IoT network environments due to their capability to model nonlinear feature interactions and capture subtle deviations in complex traffic [37,38].

4.2. XGBoost Integration

To enhance detection accuracy and generalization, the second model integrates Extreme Gradient Boosting (XGBoost) with the learned representations from the autoencoder and GMM. In this semi-supervised setup, the AE-GMM pipeline first extracts meaningful features—including the reconstruction error, latent vectors, and GMM-derived scores—which are then used as inputs to the XGBoost classifier. XGBoost operates as a powerful ensemble method that constructs an optimized set of decision trees using gradient boosting, effectively capturing complex nonlinear relationships in the transformed feature space.
The model was trained on both NSL-KDD and UNSW-NB15 datasets after normalization and feature selection to ensure consistent input dimensions. The use of XGBoost significantly improved detection metrics, yielding high precision, recall, and F1-scores across both datasets. This improvement stems from the model’s ability to correct classification residuals iteratively and its robustness against overfitting through regularization and shrinkage techniques.
Furthermore, AE-GMM-XGBoost provides interpretable feature importance measures, allowing for analysis of the relative contribution of latent, probabilistic, and statistical attributes to intrusion prediction. Previous studies have confirmed that AE-GMM-XGBoost consistently outperforms traditional classifiers in intrusion detection due to its efficiency, scalability, and adaptive learning mechanism [34,39].

4.3. Logistic Regression Integration

The third model integrates AE-GMM-Logistic Regression (LR) with the autoencoder-derived feature set as a lightweight and interpretable AE-GMM. After feature extraction and normalization, the latent features and reconstruction errors from the AE-GMM were fed into a binary logistic classifier to distinguish between normal and anomalous traffic. AE-GMM-Logistic Regression, being a linear probabilistic model, estimates the likelihood of a connection belonging to a specific class based on weighted feature contributions.
This model serves two main purposes:
(1) The first is providing a transparent benchmark against more complex models such as AE-GMM-XGBoost, and (2) the second is demonstrating that even simple linear classifiers can achieve competitive results when coupled with effective representation learning. Regularization (L2 penalty) was employed to prevent overfitting and stabilize the coefficients across features with different scales.
Experimental outcomes indicate that AE-GMM-Logistic Regression achieves high detection accuracy with strong generalization across both datasets, particularly when trained on AE-transformed inputs. Similar hybrid frameworks combining feature extraction from deep models with interpretable classifiers have been shown to balance accuracy and explainability in modern intrusion detection systems [24,40].

4.4. Summary of Methodology

The methodology implemented in this research follows a structured and data-driven approach to evaluate three complementary intrusion detection models under uniform experimental settings. The Autoencoder-Gaussian Mixture Model (AE-GMM) was employed as a foundational unsupervised framework capable of capturing nonlinear relationships in the latent feature space. This model established a reference point for intrusion energy distribution and provided a reconstruction-based perspective on abnormal behaviors.
Building upon this AE-GMM, the AE-GMM-XGBoost model introduced a gradient-boosting ensemble mechanism that leveraged the same preprocessed and feature-selected data to enhance detection precision. Its ability to iteratively minimize classification errors allowed the model to achieve higher discrimination between normal and attack patterns while maintaining computational efficiency.
The AE-GMM-Logistic Regression model, in turn, served as a transparent and interpretable counterpart within the hybrid framework. By using the same standardized and reduced feature set, it enabled a direct comparison between deep, ensemble, and linear learning strategies. This integration highlighted how simpler linear models could still perform effectively when combined with robust preprocessing and feature engineering.
Collectively, the three models were trained and tested on the NSL-KDD and UNSW-NB15 datasets using identical data preparation, ensuring fairness in performance evaluation. Each model contributed a distinct analytical perspective—unsupervised representation from AE-GMM, ensemble-based learning from AE-GMM-XGBoost, and linear interpretability from AE-GMM-Logistic Regression—thereby creating a comprehensive framework for assessing intrusion detection in network security. The methodological design ensures that the outcomes are reproducible, comparable, and grounded in practical cybersecurity challenges.

4.5. Evaluation Metrics

To assess the performance of the proposed intrusion detection models, several well-established evaluation metrics were employed, namely accuracy, precision, recall, F1-score, and the confusion matrix. These indicators collectively measure how effectively each model differentiates between normal and malicious network traffic.
The evaluation metrics are expressed as
A c c u r a c y = T P + T N T P + T N + F P + F N
P r e c i s i o n = T P T P + F P
R e c a l l = T P T P + F N
F 1   S c o r e = 2 · P r e c i s i o n · R e c a l l P r e c i s i o n + R e c a l l
where
  • TP (true positive) represents attack instances correctly identified as attacks.
  • TN (true negative) refers to normal instances correctly recognized as normal.
  • FP (false positive) indicates normal traffic that was incorrectly classified as an attack.
  • FN (false negative) denotes attack traffic that was misclassified as normal.
The confusion matrix provides a comprehensive summary of these outcomes, illustrating the correct and incorrect classifications made by the models. It serves as a valuable tool for analyzing detection accuracy and identifying potential misclassification trends across different attack categories.

5. Results and Discussion

5.1. Overview of Experimental Evaluation

To evaluate the effectiveness and robustness of the proposed intrusion detection framework, three different models, Autoencoder-GMM, AE-GMM-Logistic Regression, and AE-GMM-XGBoost, were trained and tested on two widely used benchmark datasets: NSL-KDD and UNSW-NB15.
Each model represents a distinct learning paradigm: the AE-GMM embodies an unsupervised intrusion detection approach; AE-GMM-Logistic Regression represents a classical linear supervised model; and AE-GMM-XGBoost reflects a modern ensemble-based method capable of learning complex, nonlinear relationships.
The evaluation employed multiple quantitative metrics, including accuracy, precision, recall, F1-score, and AUC, to comprehensively assess the models’ detection capability, reliability, and generalization performance.
This combination of metrics provides a balanced view between false alarms (precision) and missed detections (recall), while AUC highlights the models’ overall discriminative ability.
To ensure statistical robustness, each experiment was repeated multiple times under fixed random seeds, and performance metrics were estimated using bootstrap resampling. Reported results in Table 6 represent mean ± standard deviation across bootstrap samples.
Table 6. Binary intrusion detection performance of the proposed models on NSL-KDD and UNSW-NB15 (Bootstrap Mean ± Standard Deviation).
In addition, paired Wilcoxon signed-rank tests were conducted between model predictions on identical test folds, and all reported performance improvements were statistically significant at p < 0.01.

5.2. Binary Classification Results

Table 6 reports the binary intrusion detection performance of the proposed models on NSL-KDD and UNSW-NB15. The hybrid models demonstrate strong and consistent discrimination between normal and malicious traffic, substantially outperforming the standalone AE-GMM baseline. These results confirm that integrating anomaly-aware latent representations with supervised classifiers yields robust and reliable detection in the binary intrusion detection setting.

5.2.1. Analysis and Discussion

The results clearly reveal the performance hierarchy among the three evaluated models. To provide an intuitive comparison of their quantitative performance, Figure 3, Figure 4, Figure 5 and Figure 6 illustrate the differences in accuracy, AUC, AUPRC, and F1-score across the NSL-KDD and UNSW-NB15 datasets, while Table 6 summarizes the detailed numerical outcomes.
Figure 3. Comparative (mean) of accuracy of AE-GMM, Logistic Regression, and AE-GMM-XGBoost on NSL-KDD and UNSW-NB15 datasets.
Figure 4. Comparison of AUC performance for the proposed models on NSL-KDD and UNSW-NB15 datasets.
Figure 5. Comparison of AUPRC performance for the proposed models on NSL-KDD and UNSW-NB15 datasets.
Figure 6. Comparison of (mean) of F1-scores across datasets and models.
Beyond quantitative performance gains, the observed superiority of the AE-GMM-XGBoost framework can be attributed to the complementary roles of representation learning, probabilistic modeling, and discriminative classification. The autoencoder effectively compresses high-dimensional network traffic into a structured latent space that preserves essential behavioral patterns while reducing noise and redundancy. The Gaussian Mixture Model further refines this representation by modeling latent density distributions, which enhances intrusion awareness by capturing deviations from normal traffic manifolds.
XGBoost, when applied to these anomaly-aware latent features, benefits from its ability to model complex nonlinear decision boundaries and handle class imbalance through gradient-optimized ensemble learning. This synergy enables the hybrid framework to detect subtle attack behaviors that may partially overlap with normal traffic patterns, a limitation commonly observed in purely unsupervised AE-GMMs, as reflected by their lower recall. In contrast, Logistic Regression exhibits more stable and interpretable behavior but remains constrained by its linear decision boundaries, explaining its comparatively reduced sensitivity in complex attack scenarios.
These findings indicate that the performance improvements are not merely numerical but stem from the principled integration of deep feature extraction, probabilistic density estimation, and supervised discrimination. The consistent results across both NSL-KDD and UNSW-NB15 further suggest that the proposed hybrid design generalizes well across datasets with different traffic characteristics and attack distributions.
To support the observed performance differences beyond point estimates, statistical validation was conducted on the test results. Specifically, 95% confidence intervals were estimated for key evaluation metrics using bootstrap resampling, which provides a robust, distribution-free assessment of metric variability. The confidence intervals associated with the AE-GMM-XGBoost model consistently indicated stable performance advantages over the other evaluated approaches, suggesting that the observed gains are robust rather than attributable to random sampling variability.
In addition, paired statistical testing was applied to compare classification outcomes under identical test conditions. The results confirm that the improvements achieved by AE-GMM-XGBoost are statistically significant, supporting the claim that its superior performance is not incidental but reflects a genuine advantage of the hybrid learning design.
The comparatively low recall observed for the standalone AE-GMM can be attributed to several methodological factors. First, reconstruction-based intrusion scoring tends to be conservative in highly imbalanced intrusion datasets, where many attack instances partially overlap with normal traffic in the feature space. In such cases, anomalous samples may be reconstructed with relatively low error, leading to an increased number of false negatives.
Second, the Gaussian Mixture Model operates under distributional assumptions that may limit its flexibility in high-dimensional latent spaces. When attack patterns are subtle or closely aligned with normal behavior, likelihood-based scoring may not sufficiently separate anomalous observations from benign ones.
Finally, the percentile-based thresholding strategy introduces an inherent trade-off between false alarms and missed detections. While the selected threshold effectively limits false positives, it may also exclude weak or emerging attack instances, thereby reducing recall. These limitations explain the observed behavior of the AE-GMM and motivate the integration of supervised classifiers that can exploit labeled decision boundaries on top of intrusion-aware representations.

5.2.2. Limitations

Despite the valuable insights provided by the AE-GMM, several limitations should be acknowledged. First, the Gaussian Mixture Model is sensitive to covariance estimation, particularly in high-dimensional latent spaces, where limited sample density can affect component separation and likelihood reliability. This sensitivity may reduce the model’s ability to distinguish subtle attack patterns that closely resemble normal traffic behavior.
Second, although early stopping and regularization mitigate overfitting, autoencoder-based representations may still capture dataset-specific regularities, which can limit robustness under distribution shifts or evolving traffic conditions. This effect is especially relevant in real-world deployments where concept drift is common.
Finally, class imbalance inherent in intrusion detection datasets poses an additional challenge for unsupervised models. When attack samples partially overlap with normal traffic in feature space, intrusion scores tend to be conservative, leading to missed detections. These limitations highlight why AE-GMM is more effective as a representation learning component rather than a standalone detector and further justify the integration of supervised classifiers to enhance sensitivity and decision boundaries.

5.2.3. Model Robustness in Real-World Deployments

Robust deployment of intrusion detection frameworks in real-world network environments requires explicit consideration of long-term correlations, error accumulation, and stability under dynamic and imperfect operating conditions. Recent studies on long-term correlated network systems emphasize that conventional models assuming short-term independence are prone to performance degradation due to cascading errors and temporal dependencies, particularly in distributed and heterogeneous infrastructures. Zhao et al. [41] demonstrated that nonlinear stochastic dependencies and delayed error propagation can significantly affect system stability if not explicitly modeled, highlighting the importance of mechanisms that mitigate error accumulation and correct instability over time [41]. In this context, the proposed hybrid AE-GMM-based framework implicitly enhances robustness by combining representation learning with probabilistic density modeling and supervised discrimination, which together reduce sensitivity to transient perturbations and localized modeling errors. The anomaly-aware latent representations learned by the autoencoder help stabilize feature distributions, while the integration of supervised classifiers constrains error propagation by enforcing discriminative decision boundaries. These design choices align with findings in long-term correlated system analysis, where robustness emerges from jointly addressing temporal dependencies, uncertainty accumulation, and adaptive correction rather than relying solely on static assumptions. Consequently, the proposed framework is better suited for real-world deployments characterized by evolving traffic patterns, delayed effects, and correlated anomalies, supporting stable and reliable intrusion detection under practical operating conditions.
In contrast, despite the clear performance differences observed across models, the standalone AE-GMM exhibits noticeably lower recall on both datasets. This behavior can be attributed to its reliance on reconstruction error and latent density estimation without class-discriminative supervision. In highly imbalanced intrusion datasets, many attack samples partially overlap with normal traffic patterns, leading unsupervised models to adopt conservative decision boundaries that reduce false positives at the expense of missed attacks. These results indicate that while AE-GMM effectively captures the structure of normal traffic, it lacks sufficient sensitivity to subtle or evolving intrusions when used in isolation.
As shown in these figures, the AE-GMM-XGBoost classifier achieved the best overall performance across both datasets, confirming its strong generalization capacity and robustness in handling complex network traffic data.
On the NSL-KDD dataset, AE-GMM-XGBoost reached an AUC of 0.9893, mean of recall of 0.9933 ± 0.0031, and mean of F1-score of 0.8892 ± 0.0027, indicating that it successfully detected nearly all intrusion attempts while maintaining a very low false positive rate.
Similarly, on the UNSW-NB15 dataset, AE-GMM-XGBoost obtained the highest mean of accuracy (0.9209 ± 0.0022) and an excellent balance between mean of precision (0.9337 ± 0.0023) and mean of recall (0.9515 ± 0.0025), confirming its effectiveness in detecting both frequent and rare attacks in modern heterogeneous traffic.
The AE-GMM-Logistic Regression model ranked second overall. Despite its linear nature, it produced remarkably stable and competitive resultsAUC = 0.9558 on NSL-KDD and 0.9383 on UNSW-NB15—proving that linear classifiers still retain value for intrusion detection tasks, especially when the data are moderately separable.
Its slightly lower recall compared to AE-GMM-XGBoost indicates reduced sensitivity to highly nonlinear patterns, which are common in modern cyberattacks.
Nevertheless, its high precision (above 0.92 on both datasets) underscores its reliability and interpretability, making it suitable for real-time or resource-constrained deployments.
Overall, the AE-GMM-XGBoost model consistently outperformed the others due to its gradient-boosted decision tree architecture, which efficiently learns both linear and nonlinear feature dependencies.
This adaptive learning mechanism makes AE-GMM-XGBoost particularly well suited for high-dimensional and heterogeneous cybersecurity data.
Meanwhile, AE-GMM-Logistic Regression served as a strong interpretable AE-GMM, and AE-GMM provided valuable insights into unsupervised intrusion detection behavior.
Together, these findings validate the potential of hybrid architectures that combine unsupervised feature extraction (e.g., autoencoder) with supervised ensemble classification (e.g., XGBoost) to achieve high detection accuracy and reduce false alarms in modern intrusion detection systems (IDSs).
To gain deeper insight into each model’s behavior in distinguishing between normal and attack instances, the confusion matrices presented in Figure 7, Figure 8 and Figure 9 were analyzed.
Figure 7. Confusion matrix of the AE-GMM model on (a) NSL-KDD dataset (b) UNSW-NB15 dataset.
Figure 8. Confusion matrix of the AE-GMM-XGBoost model on (a) NSL-KDD dataset (b) UNSW-NB15 dataset.
Figure 9. Confusion matrix of the AE-GMM-Logistic Regression model on (a) NSL-KDD dataset (b) UNSW-NB15 dataset.
These visual representations provide a granular view of how each classifier handled true positives (TPs), false positives (FPs), true negatives (TNs), and false negatives (FNs) across the NSL-KDD and UNSW-NB15 datasets.
As shown in Figure 7a, the AE-GMM on the NSL-KDD dataset produced a large number of false negatives (9215), indicating that many attack instances were misclassified as normal. Although the model correctly detected 496 attacks, its imbalance between true positives and false negatives led to very low recall performance.
A similar pattern is visible in Figure 7b for UNSW-NB15, where the model correctly classified 9142 attack samples but failed to detect over 110,000 attack cases.
This confirms that the unsupervised AE-GMM approach, while capable of identifying clear outliers, struggles to detect subtle or overlapping intrusion patterns, particularly in complex network environments.
In contrast, AE-GMM-XGBoost demonstrated excellent discrimination ability, as illustrated in Figure 8a,b. For NSL-KDD, the model correctly identified 9646 attack instances with only 65 false negatives, yielding near-perfect recall.
Similarly, for UNSW-NB15, it correctly detected 113,547 attacks while misclassifying only a small number (5794), confirming the model’s robustness and adaptability to varying attack types.
This strong performance reflects the model’s capability to capture nonlinear feature interactions through gradient-boosted decision trees, resulting in precise decision boundaries even under class imbalance.
The AE-GMM-Logistic Regression model also achieved stable and balanced performance, as shown in Figure 9a,b.
On the NSL-KDD dataset, it identified 9016 attacks with only 695 false negatives, while maintaining a high number of true negatives (10,882).
In the UNSW-NB15 dataset, the classifier maintained consistent detection ability with 108,753 true positives and 10,588 false negatives, showcasing a strong trade-off between precision and recall.
Although slightly inferior to AE-GMM-XGBoost in capturing complex nonlinearities, AE-GMM-Logistic Regression’s consistent accuracy across both datasets demonstrates its reliability and interpretability, two characteristics that are valuable in practical network defense systems.
In summary, the confusion matrix analysis corroborates the numerical results presented earlier:
  • AE-GMM was overly conservative, leading to under-detection of attacks (low recall).
  • AE-GMM-Logistic Regression maintained balanced precision–recall behavior with good detection coverage.
  • AE-GMM-XGBoost achieved the most effective trade-off, minimizing false negatives without inflating false positives.
In addition to detection performance, the computational characteristics of the evaluated models were analyzed. The AE-GMM required the lowest training overhead but exhibited higher inference latency due to density estimation in the latent space. AE-GMM-Logistic Regression showed fast training and low memory usage, making it suitable for resource-constrained environments. In contrast, AE-GMM-XGBoost involved a higher training time due to ensemble construction, while maintaining efficient inference once deployed. Overall, the results indicate a clear trade-off between detection accuracy and computational cost, allowing model selection to be guided by deployment constraints.

5.3. Multi-Class Classification Result

Multi-class intrusion detection poses a more challenging classification problem due to the overlap between attack categories and the presence of minority classes. This evaluation therefore provides a deeper assessment of the proposed framework’s ability to learn discriminative representations and maintain reliable detection performance across diverse intrusion types.
The following table presents the comparative multi-class performance on NSL-KDD and UNSW-NB15.
Table 7 presents the macro-averaged multi-class intrusion detection performance of the proposed models on the NSL-KDD and UNSW-NB15 datasets. All metrics are reported as mean ± standard deviation obtained through bootstrap resampling, providing a statistically robust estimation of model performance. The standalone AE-GMM exhibits limited effectiveness, achieving accuracies of 45.14% on NSL-KDD and 41.95% on UNSW-NB15, reflecting the difficulty of purely unsupervised multi-class intrusion detection. In contrast, the hybrid models deliver substantially stronger results: AE-GMM-XGBoost attains accuracies of 89.46% and 89.09%, while AE-GMM-Logistic Regression achieves 88.24% and 89.69% on NSL-KDD and UNSW-NB15, respectively. These results confirm that anomaly-aware latent representations significantly enhance class separability and detection reliability across diverse attack categories.
Table 7. Macro-averaged multi-class intrusion detection performance on NSL-KDD and UNSW-NB15 using bootstrap estimation (Mean ± Standard Deviation).
Table 8 provides a direct methodological and performance comparison between the proposed framework and a representative recent study on intrusion detection using the UNSW-NB15 dataset. More et al. [42] employed classical machine learning models trained on raw preprocessed features combined with conventional feature selection techniques, reporting best accuracies of 85.99% for binary classification and 75.77% for multi-class classification. In contrast, the proposed framework introduces anomaly-aware latent representation learning through the AE-GMM module prior to supervised classification. This design enables the classifiers to operate on representations that capture deviations from normal network behavior rather than relying solely on raw features. As a result, the proposed approach achieves higher accuracies of 92.09% in binary classification and 89.69% in multi-class classification, with bootstrap-based evaluation confirming the stability and consistency of these improvements.
Table 8. Methodological and performance comparison with existing IDS studies.

5.4. Visual Interpretation and Evaluation

5.4.1. Visual Interpretation

Figure 10, Figure 11, Figure 12 and Figure 13 illustrate the ROC and precision–recall curves for all evaluated models. The graphical analysis confirms the consistency of the quantitative findings. AE-GMM-XGBoost achieved the largest areas under both ROC and PR curves on the NSL-KDD and UNSW-NB15 datasets, reflecting its strong sensitivity and precision across varying thresholds. AE-GMM-Logistic Regression followed with smooth and stable curves, indicating balanced predictive performance and good generalization. In contrast, the AE-GMM displayed flatter ROC curves closer to the diagonal, suggesting weaker separation between normal and attack instances. Overall, the visual comparison demonstrates that ensemble-based learning, represented by XGBoost, delivers superior discrimination capability, while linear and unsupervised models exhibit moderate yet complementary performance patterns.
Figure 10. ROC curve comparison for NSL-KDD dataset.
Figure 11. Precision–recall curve comparison for NSL-KDD dataset.
Figure 12. ROC curve comparison for UNSW-NB15 dataset.
Figure 13. Precision–recall curve comparison for UNSW-NB15 dataset.

5.4.2. Evaluation

To evaluate the effectiveness and reliability of the proposed hybrid framework, several standard performance metrics were adopted, including the ROC curve, precision, recall curve, and confusion matrix. These metrics provide a comprehensive view of model performance from both statistical and visual perspectives. The ROC and PR curves are used to analyze sensitivity and precision across thresholds, while the confusion matrix allows for examination of correct and incorrect classifications for each category. By relying on these complementary measures, the evaluation process ensures that the results reflect not only overall accuracy but also the detection consistency and robustness of the AE-GMM, AE-GMM-XGBoost, and AE-GMM-Logistic Regression models across both benchmark datasets.

6. Conclusions and Future Work

6.1. Conclusions

This research introduced and evaluated a hybrid intrusion detection framework combining deep feature extraction through an Autoencoder-Gaussian Mixture Model (AE-GMM) with advanced supervised classifiers, AE-GMM-XGBoost and AE-GMM-Logistic Regression, to enhance intrusion detection in complex network environments.
The experimental analysis on the NSL-KDD and UNSW-NB15 datasets demonstrated that the proposed hybrid approach achieved significant improvements in detection accuracy and reliability compared with the AE-GMM unsupervised model.
Among the tested models, AE-GMM-XGBoost consistently provided the highest detection capability, achieving an AUC above 0.97 and F1-scores exceeding 0.94 ± 0.0021, confirming its effectiveness in recognizing both frequent and rare attack patterns with minimal false alarms.
AE-GMM-Logistic Regression, while simpler, maintained competitive and stable performance with strong precision and interpretability, making it suitable for deployment in environments with limited computational resources.
The AE-GMM, despite its lower recall, offered valuable insights into the latent structure of network behavior and demonstrated potential for unsupervised intrusion discovery when labeled data are scarce.
Overall, the results confirm that integrating deep representation learning with ensemble-based and interpretable classifiers yields a more adaptive and reliable detection strategy.
The findings emphasize the importance of hybrid frameworks that leverage both unsupervised feature learning and supervised optimization, enabling accurate, explainable, and scalable intrusion detection across evolving network conditions.

6.2. Future Work

Building upon the promising outcomes of this research, several future directions can be considered to further strengthen the proposed hybrid intrusion detection framework.
A key focus could be the adoption of federated learning, allowing for distributed model training across multiple nodes without sharing raw data. This approach enhances privacy, scalability, and adaptability for real-world network environments where data heterogeneity is common.
The integration of explainable AI (XAI) techniques, such as SHAP or LIME, represents another promising direction. These methods can clarify how individual network features influence model decisions, improving interpretability and user confidence in automated detection outcomes.
Additionally, implementing adaptive or continual learning strategies would allow the model to evolve alongside new attack behaviors and dynamic traffic patterns, ensuring long-term robustness and reliability.
Finally, expanding the evaluation to IoT and cloud infrastructures could provide further insight into the framework’s generalization capability across diverse operational domains.
Advancing in these directions may lead to the development of a more intelligent, privacy-preserving, and self-adaptive intrusion detection system capable of sustaining effective defense mechanisms within complex and evolving cybersecurity landscapes.

Author Contributions

Conceptualization, S.A.H. and S.R.R.; methodology, S.A.H. and S.R.R.; validation, S.A.H. and S.R.R.; formal analysis, S.A.H. and S.R.R.; investigation, S.A.H. and S.R.R.; resources, S.A.H.; data curation, S.A.H. and S.R.R.; writing—original draft preparation, S.A.H.; writing—review and editing, S.A.H. and S.R.R.; visualization, S.A.H.; supervision, S.R.R.; project administration, S.A.H. and S.R.R.; funding acquisition, S.A.H. and S.R.R.; All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The datasets analyzed during the current study are available in the Kaggle repository: https://www.kaggle.com/datasets/mrwellsdavid/unsw-nb15 and https://www.kaggle.com/datasets/hassan06/nslkdd (accessed on 27 October 2025).

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A. Implementation Details and Hyperparameter Configuration

Table A1. Architectural configuration of the autoencoder model.
Table A2. Configuration of the Gaussian Mixture Model applied to latent representations.
Table A3. Main hyperparameter settings of the XGBoost classifier.
Table A4. Configuration of the Logistic Regression Baseline Model.
Table A5. Preprocessing and Feature Selection Procedures.

References

  1. Schummer, P.; del Rio, A.; Serrano, J.; Jimenez, D.; Sánchez, G.; Llorente, Á. Machine Learning-Based Network Anomaly Detection: Design, Implementation, and Evaluation. AI 2024, 5, 2967–2983. [Google Scholar] [CrossRef] [Scilit]
  2. Edozie, E.; Shuaibu, A.N.; Sadiq, B.O.; John, U.K. Artificial intelligence advances in anomaly detection for telecom networks. Artif. Intell. Rev. 2025, 58, 4. [Google Scholar] [CrossRef] [Scilit]
  3. Ankalaki, S.; Atmakuri, A.R.; Pallavi, M.; Hukkeri, G.S.; Jan, T.; Naik, G.R. Cyber Attack Prediction: From Traditional Machine Learning to Generative Artificial Intelligence. IEEE Access 2025, 13, 44662–44706. [Google Scholar] [CrossRef] [Scilit]
  4. Neloy, A.A.; Turgeon, M. A comprehensive study of auto-encoders for anomaly detection: Efficiency and trade-offs. Mach. Learn. Appl. 2024, 17, 100572. [Google Scholar] [CrossRef] [Scilit]
  5. Sánchez-Zas, C.; Larriva-Novo, X.; Villagrá, V.A.; Rodrigo, M.S.; Moreno, J.I. Design and Evaluation of Unsupervised Machine Learning Models for Anomaly Detection in Streaming Cybersecurity Logs. Mathematics 2022, 10, 4043. [Google Scholar] [CrossRef] [Scilit]
  6. Mohsin, D.; Ali, A.; Lloret, J. An Integrated Hybrid Deep Learning Framework for Intrusion Detection in IoT and IIoT Networks Using CNN-LSTM-GRU Architecture. Computation 2025, 13, 222. [Google Scholar]
  7. Kamal, H. Robust Intrusion Detection System Using an Improved Hybrid Deep Learning Model for Binary and Multi-Class Classification in IoT Networks. Technologies 2025, 13, 102. [Google Scholar] [CrossRef] [Scilit]
  8. Adefemi, K.O.; Mutanga, M.B. A Hybrid CNN—GRU Deep Learning Model for IoT Network Intrusion Detection. J. Sens. Actuator Netw. 2025, 14, 96. [Google Scholar] [CrossRef] [Scilit]
  9. Kamal, H.; Mashaly, M. Enhanced Hybrid Deep Learning Models-Based Anomaly Detection Method for Two-Stage Binary and Multi-Class Classification of Attacks in Intrusion Detection Systems. Algorithms 2025, 18, 69. [Google Scholar] [CrossRef] [Scilit]
  10. Hussein, S.A.; Répás, S. An AI-Driven Framework for Network Intrusion Detection Using ANOVA-Based Feature Selection. Int. J. Adv. Comput. Sci. Appl. (ijacsa) 2025, 16, 853–861. [Google Scholar] [CrossRef] [Scilit]
  11. Liu, Y.; Ren, S.; Wang, X.; Zhou, M. Temporal Logical Attention Network for Log-Based Anomaly Detection in Distributed Systems. Sensors 2024, 24, 7949. [Google Scholar] [CrossRef] [Scilit]
  12. Wang, F.; Jiang, Y.; Zhang, R.; Wei, A.; Xie, J.; Pang, X. A Survey of Deep Anomaly Detection in Multivariate Time Series: Taxonomy, Applications, and Directions. Sensors 2025, 25, 190. [Google Scholar] [CrossRef] [Scilit]
  13. Moustafa, N.; Slay, J. UNSW-NB15: A comprehensive data set for network intrusion detection systems (UNSW-NB15 network data set). In Proceedings of the 2015 Military Communications and Information Systems Conference (MilCIS), Canberra, Australia, 10–12 November 2015; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
  14. Tavallaee, M.; Bagheri, E.; Lu, W.; Ghorbani, A.A. A detailed analysis of the KDD CUP 99 data set. In Proceedings of the Second IEEE Symposium on Computational Intelligence for Security and Defence Applications, Ottawa, ON, Canada, 8–10 July 2009; pp. 1–6. [Google Scholar]
  15. Swileh, M.N.; Zhang, S. Unseen Attack Detection in Software-Defined Networking Using a BERT-Based Large Language Model. AI 2025, 6, 154. [Google Scholar] [CrossRef] [Scilit]
  16. Hou, Y.; He, R.; Dong, J.; Yang, Y.; Ma, W. IoT Anomaly Detection Based on Autoencoder and Bayesian Gaussian Mixture Model. Electronics 2022, 11, 3287. [Google Scholar] [CrossRef] [Scilit]
  17. Khan, W.; Haroon, M.; Khan, A.N.; Hasan, M.K.; Khan, A.; Mokhtar, U.A. Dvaegmm: Dual variational autoencoder with gaussian mixture model for anomaly detection on attributed networks. IEEE Access 2022, 10, 91160–91176. [Google Scholar] [CrossRef] [Scilit]
  18. Liao, W.; Guo, Y.; Chen, X.; Li, P. A unified unsupervised gaussian mixture variational autoencoder for high dimensional outlier detection. In Proceedings of the 2018 IEEE International Conference on Big Data (Big Data), Seattle, WA, USA, 10–13 December 2018; pp. 1208–1217. [Google Scholar]
  19. Xie, L.; Guo, T.; Chang, J.; Wan, C.; Hu, X.; Yang, Y.; Ou, C. A novel model for ship trajectory anomaly detection based on gaussian mixture variational autoencoder. IEEE Trans. Veh. Technol. 2023, 72, 13826–13835. [Google Scholar] [CrossRef] [Scilit]
  20. Guan, Y.; Xu, Y.; Xi, Y.; Li, D. Variational auto encoder fused with Gaussian process for unsupervised anomaly detection. J. Supercomput. 2024, 80, 7662–7690. [Google Scholar] [CrossRef] [Scilit]
  21. Zou, F.; Shi, R.; Luo, Y.; Hu, Z.; Zhong, H.; Wang, W. Expressway ETC Transaction Data Anomaly Detection Based on TL-XGBoost. Electronics 2024, 13, 202. [Google Scholar] [CrossRef] [Scilit]
  22. Adewole, K.S.; Jacobsson, A.; Davidsson, P. Intrusion Detection Framework for Internet of Things with Rule Induction for Model Explanation. Sensors 2025, 25, 1845. [Google Scholar] [CrossRef] [Scilit]
  23. Ismail, E.; Zayid, M.; Isah, I.; Humayed, A.A.; Adam, Y.A. Innovating Intrusion Detection Classification Analysis for an Imbalanced Data Sample. Information 2025, 16, 883. [Google Scholar] [CrossRef] [Scilit]
  24. Hafid, A.; Rahouti, M.; Aledhari, M. Optimizing Intrusion Detection in IoMT Networks Through Interpretable and Cost-Aware Machine Learning. Mathematics 2025, 13, 1574. [Google Scholar] [CrossRef] [Scilit]
  25. Muis, A.; Sari, R.F. Intelligent Intrusion Detection System Against Various Attacks Based on a Hybrid Deep Learning Algorithm. Sensors 2025, 25, 580. [Google Scholar] [CrossRef] [Scilit]
  26. Joshi, V.R.; Assa-agyei, K.; Al-hadhrami, T. Hybrid AI Intrusion Detection: Balancing Accuracy and Efficiency. Sensors 2025, 25, 7564. [Google Scholar] [CrossRef] [Scilit]
  27. Chinnasamy, R.; Subramanian, M.; Veerappampalayam, S.; Cho, J. Deep learning-driven methods for network-based intrusion detection systems: A systematic review. ICT Express 2025, 11, 181–215. [Google Scholar] [CrossRef] [Scilit]
  28. Zhang, Y.; Muniyandi, R.C. A Review of Deep Learning Applications in Intrusion Detection Systems: Overcoming Challenges in Spatiotemporal Feature Extraction and Data Imbalance. Appl. Sci. 2025, 15, 1552. [Google Scholar] [CrossRef] [Scilit]
  29. Sadhwani, S.; Khan, M.A.H.; Muthalagu, R.; Pawar, P.M.; Suresh, K. A hybrid BiLSTM-CNN approach for intrusion detection for IoT applications. Sci. Rep. 2025, 16, 155. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  30. Wu, X.; Zhang, Y.; Shi, M.; Li, P.; Li, R.; Xiong, N.N. An adaptive federated learning scheme with differential privacy preserving. Futur. Gener. Comput. Syst. 2022, 127, 362–372. [Google Scholar] [CrossRef] [Scilit]
  31. Koukaras, P.; Tjortjis, C. Data Preprocessing and Feature Engineering for Data Mining: Techniques, Tools, and Best Practices. AI 2025, 6, 257. [Google Scholar] [CrossRef] [Scilit]
  32. Almuqren, L.; Maashi, M.S.; Alamgeer, M.; Mohsen, H.; Hamza, M.A.; Abdelmageed, A.A. Explainable Artificial Intelligence Enabled Intrusion Detection Technique for Secure Cyber-Physical Systems. Appl. Sci. 2023, 13, 3081. [Google Scholar] [CrossRef] [Scilit]
  33. Ali, M.L.; Thakur, K.; Schmeelk, S.; Debello, J.; Dragos, D. Deep Learning vs. Machine Learning for Intrusion Detection in Computer Networks: A Comparative Study. Appl. Sci. 2025, 15, 1903. [Google Scholar] [CrossRef] [Scilit]
  34. Rai, H.M.; Yoo, J.; Agarwal, S. The Improved Network Intrusion Detection Techniques Using the Feature Engineering Approach with Boosting Classifiers. Mathematics 2024, 12, 3909. [Google Scholar] [CrossRef] [Scilit]
  35. Sezgin, A.; Ulaş, M.; Boyacı, A. Multi-Objective Feature Selection for Intrusion Detection Systems: A Comparative Analysis of Bio-Inspired Optimization Algorithms. Sensors 2025, 25, 6099. [Google Scholar] [CrossRef] [Scilit]
  36. Ozkan-Okay, M.; Samet, R.; Aslan, Ö.; Kosunalp, S.; Iliev, T.; Stoyanov, I. A Novel Feature Selection Approach to Classify Intrusion Attacks in Network Communications. Appl. Sci. 2023, 13, 1067. [Google Scholar] [CrossRef] [Scilit]
  37. Kim, D.; Im, H.; Lee, S. Adaptive Autoencoder-Based Intrusion Detection System with Single Threshold for CAN Networks. Sensors 2025, 25, 4174. [Google Scholar] [CrossRef] [Scilit]
  38. Wang, C.; Liu, H.; Li, C.; Sun, Y.; Wang, W.; Wang, B. Robust Intrusion Detection for Industrial Control Systems Using Improved Autoencoder and Bayesian Gaussian Mixture Model. Mathematics 2023, 11, 2048. [Google Scholar] [CrossRef] [Scilit]
  39. Nassreddine, G.; Nassereddine, M.; Al-Khatib, O. Ensemble Learning for Network Intrusion Detection Based on Correlation and Embedded Feature Selection Techniques. Computers 2025, 14, 82. [Google Scholar] [CrossRef] [Scilit]
  40. Alabbadi, A.; Bajaber, F. An Intrusion Detection System over the IoT Data Streams Using eXplainable Artificial Intelligence (XAI). Sensors 2025, 25, 847. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  41. Zhao, H.; Yan, L.; Hou, Z.; Lin, J.; Zhao, Y.; Ji, Z.; Wang, Y. Error Analysis Strategy for Long-Term Correlated Network Systems: Generalized Nonlinear Stochastic Processes and Dual-Layer Filtering Architecture. IEEE Internet Things J. 2025, 12, 33731–33745. [Google Scholar] [CrossRef] [Scilit]
  42. More, S.; Idrissi, M.; Mahmoud, H. Enhanced Intrusion Detection Systems Performance with UNSW-NB15 Data Analysis. Algorithms 2024, 17, 64. [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.