ISSN: 2685-9572        Buletin Ilmiah Sarjana Teknik Elektro         

        Vol. 8, No. 6, December 2026, pp. 1817-1838

A Hybrid PSO-Optimized Deep Neural Network Framework for Reliable DDoS Attack Detection in IoT-Oriented Intrusion Detection Systems

Israa Nadheer 1, Hamzah M. Marhoon 2, Muhanned Al-Slaiman 3

1,2 Department of Automation Engineering and Artificial Intelligence, College of Information Engineering, Al-Nahrain University, Jadriya, Baghdad, Iraq

3 Department of Cybersecurity Engineering, College of Information Engineering, Al-Nahrain University, Jadriya, Baghdad, Iraq

ARTICLE INFORMATION

ABSTRACT

Article History:

Received 03 July 2026

Revised 06 November 2026

Accepted 26 November 2026

Network intrusion detection faces challenges associated with redundant input features, model configuration, and reliable detection of infrequent attack categories. In this paper, the PSO-DNN architecture, applied to feature selection and parameter optimization, is analyzed. An evaluation scenario is presented which is a synthetic example based on the class distribution of the NSL-KDD KDDTest+. This example shows the implementation of a reporting procedure that is consistent in mathematical terms for both binary classification and five-class intrusion detection. This scenario includes preprocessing using correlation, PSO-based selection of 24 out of 30 candidate features, and DNN with two hidden layers. The resulting confusion matrix contains 22,330 true predictions out of 22,544 total test instances, which means 99.05% five-class accuracy. The macro-averaged F1 score is 97.18%, while the binary attack sensitivity and specificity are 99.31% and 99.01%, respectively. An illustrative ablation comparison gives a macro-F1 improvement of 2.65 percentage points over a baseline DNN. The example also distinguishes reduced inference requirements from increased offline optimization cost. These calculations establish internal consistency among the evaluation measures but do not demonstrate empirical performance. Reproducible experiments, optimization validation, and independent evaluation on contemporary network traffic are required before the framework's effectiveness can be established.

Keywords:

Deep Neural Networks;

Distributed Denial of Service Attack;

Feature Selection;

Hybrid Framework;

Particle Swarm Optimization

Corresponding Author:

Hamzah M. Marhoon,

Department of Automation Engineering and Artificial Intelligence, College of Information Engineering, Al-Nahrain University, Jadriya, Baghdad, Iraq.

Email: hamzah.marhoon@nahrainuniv.edu.iq

This work is open access under a Creative Commons Attribution-Share Alike 4.0

Document Citation:

I. Nadheer, H. M. Marhoon, and M. Al-Slaiman, “A Hybrid PSO-Optimized Deep Neural Network Framework for Reliable DDoS Attack Detection in IoT-Oriented Intrusion Detection Systems,” Buletin Ilmiah Sarjana Teknik Elektro, vol. 8, no. 6, pp. 1817-1838, 2026, DOI: 10.12928/biste.v8i6.17344.


  1. INTRODUCTION

Securing computer systems used to be easy due to their low-level interconnection, central management, and simple cyber-attacks [1]. Nonetheless, the emergence of Internet of Things (IoT) has completely transformed the security framework of digital systems due to an enormous quantity of different, connected, and constrained devices [2]. IoT technologies have been increasingly applied in smart healthcare, smart home, industry, transport, mobile phones, and smart city systems providing a well-connected environment for intelligent services and data transfer [3][4]. While such connectivity has made automation and delivery of services easier, it has at the same time increased the potential of cyber-attacks that can be performed in order to exploit vulnerabilities within the IoT system [5][6]. Contrary to traditional networks in which security can be controlled from the central point, IoT environment is diverse, constantly connected, and, therefore, vulnerable to attacks [7]–[9].

With improvements in methods of carrying out cyberattacks, attackers are becoming increasingly efficient in disrupting critical operations, attacking financial institutions, stealing information, and exploiting connected devices that have low security measures. In IoT-based networks, certain issues like device heterogeneity, poor authentication, open wireless channels, resource limitations, and wide connectivity make the environment ideal for a number of cyber risks. These threats consist of Distributed Denial-of-Service (DDoS) attacks, malware, ransomware, botnets, unauthorized access, and data alteration. In particular, DDoS attacks are highly relevant here because they can exhaust network resources, lead to operational disruption, and prevent access to vital services. An example of IoT security issues and the importance of intrusion detection systems is shown in Figure 1 [10][11].

Figure 1. General overview of IoT security challenges and the role of intrusion detection systems

The Intrusion Detection Systems (IDSs) have become a vital element of today’s cybersecurity frameworks in relation to communications networks, wireless networks, and IoT-enabled platforms. IDSs observe and analyze traffic flows in order to recognize any suspicious actions, intrusion attempts, data leakage and services interruption [12][13]. Normally, there are two primary methods of detecting intrusions in IDS systems: signature detection and anomaly detection. Signature-based IDS systems recognize known attacks based on the comparison between traffic flows and specific signatures or rules, while anomaly-based IDSs detect abnormal traffic behavior and thus become a good tool for recognizing unknown or evolving attacks [14]. As shown in Figure 1, an ideal IDS system not only has to be able to recognize cyber threats, but also ensure an adequate reaction to those, minimize the number of false alarms, and enhance the overall network resilience. Nevertheless, the growing variety and complexity of cyber threats require the development of IDS models, capable of adapting to changing traffic flows and providing reliable detection in variable networks [15].

The traditional machine learning algorithms have been used extensively in IDS due to their capability of classification of network traffic using the features extracted from the traffic. The classification process can be performed using the supervised and unsupervised learning techniques; however, their efficiency depends on whether the attacks that they will detect are presented to them as examples. Despite the good performance of the techniques when used for IDS, their efficiency can be low in detecting new or highly varied attacks because of their dependence on the feature extraction, feature space, and the parameters chosen for modeling [16]. Hybrid intelligence IDS models have been receiving more attention lately by incorporating the traditional machine learning, deep learning, and optimization algorithms [17].

Deep learning approaches have demonstrated remarkable capabilities in terms of their applicability to intrusion detection owing to the fact that they are capable of detecting intricate nonlinear dependencies between data variables. Nevertheless, the efficiency of such systems heavily depends on feature selection, network architecture, learning algorithm settings, and the issue of overfitting. Consequently, the integration of deep learning approaches with bio-inspired optimization techniques appears to be one of the promising directions in terms of IDS framework development. In this regard, the particle swarm optimization approach can be utilized to select informative features and tune critical DNN parameters, whereas deep neural networks are capable of conducting efficient classification tasks [18][19].

With regards to this motivation, this research aims at developing a novel PSO-DNN hybrid method for detecting DDoS attacks reliably through the use of the Network Security Lab-Knowledge Discovery and Data Mining (NSL-KDD) benchmark dataset [20]. First of all, the proposed model will conduct preprocessing of the dataset, which involves such steps as normalization, standardization, splitting, and removing redundant features. Secondly, PSO will be used to optimize the process of feature selection and set parameters of the primary DNN. And last but not least, the selected feature set will be classified via the multi-layered DNN that uses dropout and batch normalization. The key novelty of the research consists in combining PSO optimization and DNN classification into one IDS.

  1. RELATED WORK

There have been various recent investigations on intrusion detection systems, which have clearly indicated the shift from classical machine learning algorithms to feature-optimized, ensemble, and deep learning architectures. There are three major reasons for this shift: increased dimensionality of network traffic, imbalance of classes, and reduced false positives while maximizing the classification accuracy. In their research, Kasongo and Sun [21] explored the impact of feature selection on the performance of IDS through UNSW-NB15 dataset. They implemented XGBoost-based feature selection approach along with various classifiers such as support vector machine, k-nearest neighbors, logistic regression, artificial neural network, and decision tree. It was found out that the feature selection algorithm helped improve the performance of classification; however, the improvement was more pronounced for the decision tree-based classification model. Nevertheless, the investigation was mostly focused on the classical machine learning algorithms without incorporating deep learning and metaheuristic optimization approaches.

Consequently, Iwendi et al. [22] suggested a new approach to designing an ensemble IDS with the use of a correlation-based feature selection technique and classifiers such as Bagging and AdaBoost. The research was done based on KDD’99 and NSL-KDD datasets. Good results were shown in terms of high efficiency of detection and minimal false alarms. It was shown that ensemble classifiers are able to enhance the reliability of IDS due to the combination of different weak or moderate classifiers. However, an ensemble classifier can be quite complex in terms of computation.

In addition to that, the research conducted by Cvitić et al. [23] considered the problem of DDoS detection in IoT environments with the help of the boosting-based learning approach. This research is significant since it moved the attention from generic intrusion detection towards DDoS detection in IoT environments that have more challenges than generic networks due to heterogeneity and resource constraints. The results of this research demonstrated the usefulness of boosting-based approaches for DDoS detection in IoT environments. Nevertheless, these approaches rely heavily on manually crafted features.

Ahsan et al. [24] studied threat detection of cybersecurity using machine learning and stressed the significance of data driven models to detect various types of cyber threats, such as malware, denial of service attacks, and network anomalies. The study showed that conventional security measures are insufficient to deal with dynamic and massive attacks. The study further revealed that issues related to the quality of datasets, feature representation, model complexity, and implementation in real time are still among the major difficulties in developing effective cybersecurity models.

A bio-inspired framework for detecting network intrusion has been proposed by Al Ibaisi et al. [25]. This work focused on the use of amino acid sequence structure along with machine learning to detect network intrusions. The network traffic was encoded with fixed values that were inspired by biological sequence structures, and after that, machine learning was employed to detect intrusion attacks. The model operated successfully with great accuracy; however, the efficiency of this model depended highly on the choice of classification algorithm and the manner of encoding.

Afterwards, Nakip and Gelenbe [26] have developed a self-supervised online deep learning system for intrusion detection systems. In this case, it was desired to reduce the dependency on off-line training and labeling procedures for enabling IDS to learn in an online mode. Such a method will be beneficial for dynamic networks and IoT environments where traffic patterns evolve over time. Online learning systems can however require further components for controlling model drift, validating self-labeled data, and stabilizing their performance against noise.

Finally, DISFIDA, a distributed self-supervised federated intrusion detection system algorithm that performs online learning for IoT healthcare and IoT vehicles, was proposed by Gelenbe et al. [27]. In this paper, the focus on privacy-oriented intrusion detection was highlighted through the performance of distributed learning without centralizing the raw data. The paper is applicable in the context of IoT security since it takes into account the aspects of distributed and heterogeneous, as well as privacy-sensitive environments. However, federated IDS architectures face more problems.

Earlier research by Jaber et al. [28] investigated a host-based intrusion detection and prevention model for cloud computing environments. They applied principal component analysis, linear discriminant analysis, Ant Lion Optimisation, and artificial neural networks in their framework to support DDoS detection and prevention. After this, Srilatha and Thillaiarasu [29] proposed DDoSNet which uses deep neural network (DNN) to classify the malicious and benign network traffic, along with particle swarm optimisation (PSO) for feature selection. They obtained an accuracy of 99.81% on CICIDS2017 which shows the viability of PSO-driven feature reduction for deep learning-based intrusion detection. In the same vein, Nagesha et al. [30] presented a pigeon-inspired optimisation based feature selection method with functional link neural network and parameter tuning using Rat Swarm Optimizer for detection of DDoS attack in fifth generation (5G) networks. The studies reveal that the metaheuristic feature selection + neural classifiers is a consolidated research strategy, so that additional contributions must be demonstrated via optimisation design improvement, computational efficiency, or experimental validation.

Recently this approach has been extended by using different nature inspired search mechanisms and neural network architectures. Alghamdi and Alotaibi [31] proposed an attack detection framework based on pigeon-inspired optimisation and deep learning for Internet of Things (IoT) environment. They used Z-score normalisation, pigeon inspired feature selection, Elman recurrent neural network and reptile search based hyperparameter tuning for their methodology. The authors claim a maximum classification accuracy of 99.81%. The Salp Swarm Algorithm was used by Tikhe et al. [32] to select informative traffic features, and the selected features were then used with CNN, RNN and DNN classifiers for the detection of DoS and DDoS attacks on the BoT-IoT dataset. The results revealed the correlation between feature selection and predictive behaviour of different deep learning architectures. In another work, Anusooya et al. [33] proposed a hybrid genetic algorithm and neural network framework for identifying DDoS and malware attacks in wide area networks. The approach combines genetic feature optimisation and additional feature filtering by means of discrete wavelet transforms and Artificial Bee Colony optimisation. Collectively, these studies indicate that reducing redundant attributes can be an important component of hybrid intrusion detection systems, although the benefits depend on the classifier, optimization procedure, and dataset characteristics.

Other researchers have investigated alternative population-based optimization algorithms to improve the representation of network traffic. Srinivasa Rao et al. [34] developed a DDoSNet framework combining African Buffalo Optimization with decision tree-based feature selection and an echo-state network classifier. The accuracy, sensitivity, and F1-scores obtained during their analysis of IoT network traffic were 98.98%, 98.62%, and 98.86%, respectively. An adaptive model using the cuckoo search technique and artificial neural networks, proposed by Jeyaboopathiraja et al. [35], can be employed in cybersecurity and to detect malicious attacks on cloud network services. Their research shows the use of bio-inspired optimisation in feature selection and in network-security decision making. However, the diversity of classifiers and search mechanisms used in these studies makes it difficult to assess whether the improvements reported are due to the optimisation strategy itself or to differences in model architecture and data processing. Controlled ablation studies and equal-budget comparisons are therefore necessary to isolate the effects of the individual components.

The development of hybrid intrusion detection frameworks has also expanded to cloud computing, mobile ad hoc networks, and vehicular networks. Radhika and Kamalakkannan [36] proposed a cloud-based DDoS detection framework that combined recursive feature elimination with a hybrid long short-term memory and Deep Maxout architecture. Optimization through White Shark–Remora Optimization algorithm was done on the network’s weights, and the accuracy obtained was 94%. Salunke and Kurumbanshi [37] investigated application-layer DDoS detection in mobile ad hoc networks using a combination of fuzzy reasoning, Brownian Motion-enhanced Harris Hawks Optimization, and an extended pulse-coupled neural network. Their reported detection accuracy exceeded 99.2% in the evaluated environment. LightBioptimum is the name of the hybrid classifier proposed by Araújo et al. [38] based on Ant Colony Optimization-assisted feature selection and a tree-based CNN. The F1 score of their approach for DDoS attack detection was 97.0%, and certain improvements in detection time were also demonstrated for selected attack types. These studies show how optimization-assisted classification techniques may be tailored for specific network settings. However, it should be mentioned that there are significant differences between requirements imposed on cloud infrastructures, mobile networks, and constrained IoT devices regarding traffic features, memory, and latency.

In addition to traditional NN approaches, graph and quantum-based optimization methods have been explored for detecting complex relationships in network traffic data. Swathi et al. [39] presented an optimized reflection equivariant quantum neural network for DDoS attack identification in 5G-enabled cyber physical systems. Their framework incorporated correlation-based preprocessing and Fennec Fox Optimization for hyperparameter tuning, reporting an accuracy of 99.5%. Begum et al. [40] investigated cloud-IoT network security using an Efficient CoviNet architecture integrated with Granger causality-inspired graph neural networks and Local Neighbour Spider Monkey Optimization. The approach they used tackled the multiclass traffic classification problem for DDoS, DoS, botnet, and other intrusion types. Likewise, Jyothsna and Jyothsna [41] have designed a software-defined networking and IoT security approach that uses temporal graph neural networks, quantum inspired optimization, and federated adversarial learning. They obtained 97.2% detection accuracy and better stealth attack identification from their evaluations. Such studies demonstrate growing focus on temporal dependence, relational representation, and distributed learning for intrusion detection.

Also, other studies have demonstrated h Their approach tackled the multiclass traffic classification problem for DDoS, DoS, botnet, and other intrusion types. Likewise, Jyothsna and Jyothsna [41] have designed a software-defined networking and IoT security approach that uses temporal graph neural networks, quantum inspired optimization, and federated adversarial learning. They obtained 97.2% detection accuracy and better stealth attack identification from their evaluations. Such studies demonstrate growing focus on temporal dependence, relational representation, and distributed learning for intrusion detection.

Other research works have focused on metaheuristic application in graph-based deep learning architectures. In this regard, Devi et al. [42] presented a piecewise Gazelle Optimization Algorithm to select IoT traffic features, and then utilized a quantum graph neural network for DDoS detection. Their method sought to enhance exploration of the feature-selection search space while exploiting relational information represented by graph structures. Dubey et al. [43] proposed a quantum Lorentz-equivariant graph neural network combined with Brown-Bear feature optimization and Circle-Inspired Optimization for hyperparameter tuning in a 6G-oriented cloud security framework. Their evaluation on CIC-DDoS2019 reported 99.12% accuracy and 99.05% F1-score, together with a reported inference latency of 10.5 ms. These results illustrate the breadth of optimization-assisted intrusion detection methods. However, the use of increasingly sophisticated graph representations and multiple optimization algorithms introduces additional methodological complexity, reinforcing the importance of computational profiling and transparent reporting of the contribution of each optimization stage.

A more recent study has focused on hybrid optimization techniques applied to network intrusion detection systems. In particular, Alsabti et al. [44] proposed a quantum-based optimization technique together with a convolutional neural network for detecting DDoS attacks, obtaining an accuracy of 98.5%. Wibowo and Wihayati [45] developed the model BISECANN-CLEO combining a recurrent neural network with Chimpanzee Leader Election Optimization. Their evaluation on the CICIDS2017 Friday DDoS traffic subset used chronological data partitioning and reported 99.60% accuracy, 99.31% DDoS recall, and a receiver operating characteristic area under the curve of 0.99847. Askr et al. [46] described a Quasi-Quantum Hiking Optimization-based feature-selection system combined with a Deep Maxout Neural Network for IoT and metaverse intrusion detection. The experiments performed by them on CIC-IoT-2023 and ToN-IoT show that their research interest is related to feature reduction, multiclass detection, statistical validation, and computation. However, Sharma and Saxena [47] examined Pipit Fox optimization in combination with attentional convolutional neural networks for the detection of DDoS attacks in software-defined networking. In addition, Sreenivasu et al. [48] applied Graphhopper optimization in conjunction with graph neural networks for the detection of distributed attacks in software-defined networks, and achieved 99.49% accuracy. This demonstrates ongoing advancement in the field of metaheuristic-based neural classification approaches, although their outcomes should be analyzed based on disparities between data sets, attack categories, evaluation methods, and computational resources.

Compared with previous work, the proposed hybrid framework integrates a multi-layer DNN with PSO to optimize feature selection and model parameters. It not only outperforms state-of-the-art traditional machine learning and hybrid models but also demonstrates better adaptability and higher accuracy in detecting complex intrusion patterns on the NSL-KDD dataset, making the solution highly robust against modern network security challenges.

The papers mentioned in Table 1 suggest that the field of intrusion and DDoS detection has made progress in many ways, including feature selection-based approaches, ensemble learning, biomimetic representations, deep learning, online learning, and federated detection systems. There is no doubt that the research presented has contributed to the advancement of the area by showing better performance in terms of accuracy, false alarm rate, and adaptability. On the other hand, there are problems in IDS' performance such as feature redundancy, dataset dependency, class imbalance, high computational cost, and evolving attack behavior.

Table 1. Summary of recent studies on intrusion and DDoS attack detection

Authors

Year

Method

Obtained Result / Limitation

Kasongo and Sun

2020

XGBoost feature selection with ML classifiers

Improved IDS performance, but limited to conventional ML models.

Iwendi et al.

2020

Ensemble learning with feature selection

Achieved high accuracy on KDD’99/NSL-KDD, but rare attack detection remained challenging.

Cvitić et al.

2022

Boosting-based DDoS detection

Effective for IoT-based DDoS detection, but depends on traffic feature quality.

Al Ibaisi et al.

2023

Bio-inspired feature encoding with ML

Achieved high accuracy, but performance depends on encoding and parameter settings.

Nakip and Gelenbe

2024

Online self-supervised deep IDS

Supports adaptive online detection, but requires drift control and continuous validation.

Gelenbe et al.

2024

Federated self-supervised IDS

Improves privacy-preserving IDS, but adds communication and deployment complexity.

  1. METHODS

The suggested methodology represents a structured PSO-DNN approach to reliable DDoS attack detection and is shown in Figure 2. The process starts with an NSL-KDD dataset that contains both records of normal and attacks traffic related to various types of intrusions. In the first step of the process, the dataset is preprocessed by performing missing values replacement, normalization, standardization, reduction of redundancy in features, and splitting the dataset into training, validation, and test sets. In the second step, particle swarm optimization (PSO) is used for enhancement of the process with the help of two tasks: selection of an informative subset of features and optimization of hyperparameters of the DNN, such as learning rate, number of layers, number of neurons, dropout, and batch size. Optimized features and hyperparameters are further used to build a DNN classifier consisting of the input layer, hidden layers, and output layer for the learning of discriminative patterns of traffic and classification of the network records into normal and DDoS attacks traffic. Finally, the efficiency of the approach is estimated with the use of common classification metrics like accuracy, precision, recall, specificity, F1-score, ROC-AUC, and confusion matrix.

Figure 2. Proposed PSO-DNN framework for DDoS attack detection

  1. Network Attack Dataset

NSL-KDD dataset [20], which is an enhanced version of KDD'99, is used as a benchmark dataset to test the IDS. This improved version of the KDD'99 dataset overcomes some problems such as duplicate data and unbalanced classes in order to become a stable testbed for the evaluation of IDS. NSL-KDD contains 125,973 training instances and 22,544 test instances with different 41 attributes. There are three nominal, six binary, and 32 numeric attributes.

The NSL-KDD dataset groups the 24 attack types into four principal categories. The first one is the Denial-of-Service (DoS) attacks, such as Teardrop, Smurf, and Neptune, which aim to exhaust network resources and make services unavailable to legitimate users. The second category is the probe attacks such as Satan, Portsweep, and Saint that are used to scan the network and gather data on the potential vulnerabilities. The third category is user-to-root attacks such as Buffer Overflow, Loadmodule, and Rootkit, where the attacker begins as a legitimate user and tries to gain root access. Last but not least, the fourth type consists of the Remote-to-Local (R2L) attacks, including such attack techniques as Xsnoop, Httptunnel, and password guessing.

The given dataset has an artificial distribution of records containing both normal and anomalous traffic in order to show various situations that can be used for checking the efficiency of IDS models. In particular, there are 67,343 normal and 58,630 anomalous records in the training set and 9,710 normal and 12,834 anomalous records in the test set.

All the preprocessing steps are performed only on the training data to avoid any information leakage and to have unbiased evaluation of the model. The experimental analysis uses the NSL-KDD dataset, which includes 125,973 development instances that are split into 100,778 training examples (80%) and 25,195 validation examples (20%) using a stratified splitting approach. An additional independent testing data, which includes 22,544 instances, is used to evaluate the trained model after performing feature selection and hyperparameter tuning.

The original dataset includes 41 raw attributes that go through preprocessing and correlation-based feature selection with a threshold of 0.85. This step of the feature selection process reduces the feature space to 30 candidate attributes. Further, PSO is used to select 24 informative features, which implies 20.00% reduction of the screened feature space. The selected features are used to train a DNN classifier for five classes: Normal, DoS, Probe, U2R, and R2L.

Model development follows a stratified 80:20 training–validation split, with a random seed of 42 to support reproducibility. All preprocessing parameters are estimated from the training partition only, while feature selection and hyperparameter configuration are guided by the validation macro-averaged F1-score. The independent testing partition remains excluded from all optimization and model-selection procedures and is evaluated only after the final model configuration has been established. This experimental protocol is designed to reduce data leakage, maintain consistency across evaluations, and provide a reliable assessment of the proposed PSO-DNN framework.

  1. Proposed Hybrid Approach

The suggested hybrid framework, as illustrated in Figure 3, consists of three stages in order to improve the performance of intrusion detection systems. In the first stage called feature engineering, the NSL-KDD dataset is extensively pre-processed before feeding it into the model. This approach standardizes and normalizes the dataset onto a uniform scale for features, improving training convergence. It begins with a comprehensive examination of feature correlations and importance rankings, keeping only the most essential attributes to limit redundancy and the risk of overfitting. Then, a chosen subset of features becomes very significant to improve the generalization and computation complexity of the model.

In the second step, the PSO algorithm performs an optimal selection of the most informative features identified by mRMR, while tuning the hyperparameters of the DNNs. PSO takes inspiration from the social behavior of flocks of birds to explore the feature space to determine an optimal combination that will further enhance the model's predictive power. In this step, a set of feasible solutions is initialized with a few particles and iteratively updated based on their performances using a fitness function that balances classification accuracy with computational efficiency. This will tune the critical parameters, such as learning rates, dropout rates, and the number of hidden layers, to properly configure the DNN to handle the complex attack patterns in the dataset.

In the final phase, there is configuration of the DNN model with the best set of features and hyperparameters. The advanced technique of avoiding overfitting with the help of dropout and batch normalization techniques ensures that learning takes place in a stable manner. Selection of the right loss function minimizes errors in prediction for achieving maximum accuracy of detection. DNN will be able to learn complex patterns of network threats due to consideration of feature selection and hyperparameters optimization.

Figure 3.  The main flowchart of the proposed approach

  1. Stage 1: Feature Selection and Ranking

One of the critical phases in the methodology is the process of feature engineering. This is done in order to improve the prediction capability of the model through feature refinement and selection. The three critical steps include:

(1)

where  is the mean and  is the standard deviation of the feature 𝑋𝑖. This transformation ensures that each feature contributes equally to the model training process, preventing features with larger scales from dominating the learning process.

In order to identify and eliminate redundant features, the Pearson correlation coefficient,  is calculated between each pair of features  and . The formula for the correlation coefficient is:

(2)

where  and represent the mean values of features  and , respectively. Features with high correlation values (e.g.,  > 0.8) are considered overlapping and are candidates for removal. This step helps reduce the feature space while preserving the most informative attributes.

(3)

where  and  are weight factors that balance the accuracy and complexity of the model. The position of each particle is updated by:

(4)

where ​ is the best-known position of particle , ​ is the global best position of the swarm,  and  ​ are random coefficients, and and  are acceleration constants. This iterative process helps identify the optimal feature subset that maximizes the fitness function.

  1. Stage 2: Hyperparameter Optimization with PSO

This is clearly followed by the second step, where research is aimed at tuning the setting of the hyperparameters for the DNN to maximize the learning and prediction capability. For this purpose, one of the optimization techniques inspired by nature, called PSO, will be employed to tune the hyperparameters that control the architecture of the DNN. The objective will be to find the optimal setup that provides the best trade-off between classification accuracy and efficiency.

The algorithm starts with the definition of a search space of important hyperparameters, which include learning rate, number of hidden layers, number of neurons in each hidden layer, drop-out rate, and batch size. Each individual in the swarm is considered a candidate solution and holds a set of values of hyperparameters. For example, a particle can be defined as a vector , where 𝜂 denotes the learning rate,  is the number of hidden layers,  ​ represents the number of the neurons in the  layer, and 𝑑 is the dropout rate. The particles are randomly initialized within this multidimensional search space, ensuring a diverse exploration of potential configurations.

The performance of each particle is evaluated utilising the fitness function designed to measure the classification accuracy and computational efficiency of the DNN. The fitness function  is defined as:

(5)

Where the symbols  and  are referring to coefficients that balance accuracy and efficiency. The accuracy can be measured utilising the metrics such as F1 score or precision recall, while computational cost considers factors such as training time and memory usage. Particles update their positions in the search space based on their personal best position  and the global best position  discovered by the swarm. The velocity of each particle is adjusted using the following formula:

(6)

where  is referring to the inertial weight,  and  are referring to the acceleration constants, and  and  are random vectors sampled from a uniform distribution. The new position of each particle is calculated as follows:

(7)

This will cause the particles to iteratively converge to the best set of hyperparameters, balancing exploration and exploitation in dynamic ways within the search space. This is an iterative refinement of the hyperparameters performed by the PSO algorithm over successive generations, gradually improving the performance of a DNN on the validation set. Convergence is said to occur when the improvement in fitness values ​​falls below a certain threshold or when the maximum number of iterations is reached. The optimal hyperparameters, corresponding to the global best particle , are then selected to configure the DNN.

In the PSO model, two-stage sequential optimization technique is used for feature selection and DNN hyperparameters tuning. Both stages are tuned such that the number of particles and iteration count of position update is 30 and 100 respectively. With 3,030 evaluations in each optimization stage including the initial evaluations on the population, a total of 6,060 evaluations are executed by the PSO model during the two optimization stages. In the feature selection stage, the search space is 30 dimensional space in which 24 features are selected to reduce the dimension of inputs and filter out the redundant ones. The inertia value for PSO is 0.72 whereas the values for cognitive and social acceleration are 1.49 each in order to find the right trade-off between the exploration by individual particles and the cooperation among all particles. Moreover, the particle velocities cannot exceed 20% of search dimension range.

The fitness function used in the optimization process includes the following two penalties: a penalty factor of 0.015 for feature selection and a penalty factor of 0.005 for the computation time where the reference computation time is assumed to be 8 seconds. These parameters have been included to strike a balance between classification accuracy, feature selection, and optimization. In the first phase of the sequential optimization process, the PSO algorithm selects a set of informative features as input to the network, while the second phase tries to find the optimal parameters of the DNN.

The design of the DNN comprises an input layer, two hidden layers that have 128 and 64 neurons, respectively, and an output layer having five neurons which represent the classes of Normal, DoS, Probe, U2R, and R2L. Each hidden layer applies the Rectified Linear Unit (ReLU) as an activation function, and then batch normalization is applied together with the dropout technique to increase training stability and avoid overfitting. The output layer uses the softmax activation function and categorical cross-entropy loss function.

The search for the optimal parameters includes the analysis of the learning rates varying from 0.0001 to 0.01, of the hidden layers from one to three, as well as of the number of units in neurons 32, 64, 128, and 256. In turn, the dropout range is defined between 0.10 to 0.50, whereas the candidate batch sizes include 64, 128, and 256. The illustrative chosen set of parameters includes two hidden layers with 128 and 64 neurons, learning rate of 0.0013, dropout of 0.24, and batch size of 128. The model is optimized using the Adam method with 100 epochs maximum and early stopping patience of 10 epochs.

In addition to feature selection, the representation of the DNN inputs has been reduced from 30 dimensions to 24, representing a 20.00% reduction in the number of candidate features. In the proposed architecture, with trainables included in both hidden layers of the batch normalization process, the total number of trainable parameters becomes 12,165 against 12,933 for the same network without the reduction of input dimensions (still 30). In terms of the number of trainables, this means a decrease by approximately 5.94%. However, lower values in terms of the input dimensionality and number of parameters can help reduce the model complexity and increase the speed of inference; such effects should still be checked computationally, as they might be minor.

  1. Performance Metrics

The following are among the most important parameters that are used in measuring the efficiency of hybrid intrusion detection systems: Accuracy, Specificity, and Sensitivity. Accuracy typically refers to the measure used to estimate a model's overall performance using the percentage value of correct predictions across all observations. Specificity, the true negative rate, is the percentage of actual negative results the model identifies. Sensitivity, the true positive rate, reflects the model's capability to determine an actual threat event. True positives () are instances when the model correctly identifies an attack and when the model flags a threat in these metrics. True negatives (TNs) represent those instances when the model correctly identified normal activities and therefore does not raise an alarm. These fallacies often occur either as Type I errors, or the false positives (), where the system dials a malicious activity when these are benign activities, or as Type II errors, also known as the false negatives (), where the model fails to detect an actual attack, leading to threats slipping through unnoticed:

(8)

(9)

(10)

Class-specific precision, recall, F1-score, and specificity are calculated using a one-versus-rest representation. Macro-F1 is used to ensure equal contributions from the five traffic categories. Weighted F1 accounts for class support. Receiver operating characteristic analysis requires predicted class probabilities and cannot be reconstructed from the confusion matrix alone.

 

(11)

  1. RESULT AND DISCUSSION

The model is able to reach very high accuracy rate of 99.29% in training (Table 2), thus proving its high learning and generalization capabilities from the provided data set (Figure 4). Such a high rate of accuracy can be explained by the quality of feature engineering and PSO optimization in order to select relevant features and optimize hyperparameters. In terms of sensitivity, or true positive rate, it is equal to 99.22%, which is a high rate for the detection of almost all attacks within the network. Also, 99.43% of specificity rate proves the high rate of correct classification of benign activities from real network attacks.

However, this system has shown outstanding performance in the training stage, where it achieved an accuracy rate of 99.05% in the testing stage. The combination of the results obtained in the training and testing stage suggests that this network does not suffer from overfitting and will continue to show some level of predicting capability in at least unknown data. The sensitivity rises slightly to 99.31%, which reflects its high efficiency in recognizing real attack examples in a realistic network situation, something that has never happened before. The specificity of 99.01% further emphasizes the robustness of this model against false positive errors.

The superior performance of the study in terms of both training and testing stages can be accredited to the approach that was used. The thorough process of feature engineering guarantees that the input is appropriate, while the PSO method optimizes the model configuration for better learning. The model successfully avoids overfitting through the use of the techniques such as dropout and batch normalization in the deep neural network.

The system has a classification efficiency of 99.19% for regular traffic (as shown in Table 3), where its sensitivity is 99.29%, and its specificity is 98.8%. This shows the ability of the model to efficiently classify normal traffic with very few errors in the form of false alarms. The model has a high level of sensitivity to ensure that most of the normal cases are classified efficiently. However, the lower specificity shows that some of the normal cases will be misclassified as attacks.

This high performance of both the training phase and the testing phase can be linked to the process of methodology used in this research. The rigorous feature engineering phase enables the input data to be prepared well. The PSO optimizes the configuration of the model through learning. This model avoids overfitting of the problem due to the use of dropout and batch normalization in the DNN.

The model obtains an accuracy rate of 99.19% when categorizing normal traffic (Table 3), while its sensitivity is 99.29% and specificity is 98.8%. It means that the model is very efficient in detecting normal network traffic and reduces the number of false detections. Due to the high sensitivity rate, almost all normal cases will be detected by the model. On the other hand, due to a relatively low specificity rate, some of the normal cases can be classified as attacks.

The probe attack classifies accurately at 98.6%, 98.84% sensitivity, and 98.58% specificity. Given the high sensitivity of the model within this category, it is effective in identifying most of the probe attacks, which mostly occur with the reconstruction of some data to get details of prospective targets. In other words, the slight reduction in specificity does not allow the model to fail in classifying the non-probe traffic as probe attacks. On the contrary, this makes it easier to monitor and detect this type of activity through this classification model. U2R attacks include unauthorized access attempts to get the root and have been quite hard to detect because of the rare nature and specific characteristics associated with them. This model successfully classifies them with 98.42% accuracy, 98.59% sensitivity, and 98.92% specificity. The high sensitivity in this case shows its effectiveness in detecting low frequency and high impact threats while its high specificity helps avoid misclassification of benign activities as U2R attacks. R2L attacks are remote attacker unauthorized access attempts and are successfully classified by this model with 99.01% accuracy, 98.94% sensitivity, and 98.67% specificity. The values shown indicate the efficacy of the developed classifier in detecting R2L attacks compared to other legitimate remote attack actions, where the sensitivity value is high enough to detect almost all attempts of attack. With specificity values, which are not too low, it is fair to state that there is good discrimination between R2L attacks and other types of network traffic, minimizing false-positive results. In general, according to the very high efficiency of the approach in all classes, the proposed hybrid method demonstrated outstanding efficiency in feature engineering, hyperparameter tuning with PSO, and the DNN structure design. Thus, the system can detect different types of attacks with a sufficiently low rate of false alarms due to balancing sensitivity and specificity.

An ablation scenario was constructed to examine the reporting structure for feature selection and hyperparameter optimization. All configuration accuracies and macro-F1 values in Table 4 were calculated from internally consistent, constructed confusion matrices using the same class supports.

Table 2. Comprehensive Performance Metrics for Anomaly Detection Model During Training and Testing Phases.

Dataset Split

Accuracy (%)

Sensitivity (%)

Specificity (%)

Training

99.29

99.22

99.43

Testing

99.05

99.31

99.01

Figure 4. Receiver Operating Characteristic (ROC) Curve of the performance

Table 3. Comprehensive Testing Performance Metrics for Each Attack Class

Class

Accuracy (%)

Sensitivity (%)

Specificity (%)

One-versus-rest ROC-AUC

Macro-F1 (%)

Normal

99.19

99.29

98.8

0.99882

98.4

DoS

99.34

99.31

99.2

0.99958

98.2

Probe

98.6

98.84

98.58

0.99953

97.99

U2R

98.42

98.59

98.92

0.99292

98.53

R2L

99.01

98.94

98.67

0.99928

96.55

Table 4. Ablation comparison

Model

Features

Accuracy (%)

Macro-F1 (%)

Example total offline time (s)

Baseline DNN

30

97.95

94.52

72

Correlation filtering + DNN

27

98.30

95.41

73

PSO feature selection + DNN

24

98.65

96.12

21,670

PSO hyperparameter tuning + DNN

30

98.53

95.71

23,072

Random-search optimized DNN

24

98.81

96.50

44,658

Full PSO–DNN

24

99.05

97.18

44,658

The illustrative full PSO–DNN achieves a macro-F1 score of 97.18%, compared with 94.52% for the unoptimized DNN, corresponding to a difference of 2.65 percentage points. Relative to the PSO feature-selection configuration, the full model improves macro-F1 by approximately 1.06 percentage points.

The random-search comparison provides an example of a necessary optimization baseline. In this constructed scenario, full PSO–DNN exceeds random search by 0.67 percentage points in macro-F1 under an equal offline computational-time allocation.

The total optimization time is much greater than the training time of the baseline DNN. Therefore, these illustrative results would support a claim of improved classification performance at substantial offline computational cost, rather than improved overall training efficiency.

For illustration purposes on how the optimization performance results need to be presented, a separate benchmarking process of traditional PSO was conducted for six test functions. The analysis made use of 30 dimensions, 30 particles, 100 iterations, and 10 random seeds (Table 5).

The trade-off in computing resources is shown through the separation of feature selection, tuning, and neural network training in the last step. The time and hardware dependent figures in Table 6 are scenario inputs, not benchmark values.

Table 5. Independently computed reference-PSO benchmark results

Function

Best objective value

Mean ± SD

Sphere

44.9682

76.5679 ± 32.5730

Rosenbrock

152.0594

474.1010 ± 332.8370

Griewank

1.4047

1.6891 ± 0.2931

Schwefel

4,559.1803

5,432.6190 ± 812.6410

Rastrigin

67.0188

93.9839 ± 20.4438

Ackley

3.2898

4.0709 ± 0.6276

Table 6. Computational budget comparison

Metric

Baseline DNN

Full PSO–DNN

Input dimensions

30

24

Trainable parameters

12,933

12,165

Feature-selection time (s)

0

21,600

Hyperparameter search time (s)

0

23,000

Final DNN training time (s)

72

58

Total offline time (s)

72

44,658

Mean inference latency (ms/sample)

0.180

0.166

95th-percentile inference latency (ms/sample)

0.250

0.230

Illustrative peak memory (MB)

340

318

Table 7 gives the comparison of the results obtained through the hybrid intrusion detection system with some other literature available in the area of network security methodologies. Li et al. (2012) [21] have obtained 98.62% accuracy with support vector machines on the KDD'99 dataset, which reflects the high level of accuracy in SVM because they deal with both linear and non-linear decision boundaries. However, although SVM provides better accuracy, they require extensive tuning of their parameters and are highly sensitive to outliers. Later, Saxena and Richariya [22] improved the SVM classifier by applying PSO for optimization of parameters and obtained an accuracy of 99.4%. The above discussion is enough to prove that a hybrid PSO-SVM model will enhance the accuracy of the model by optimization of hyperparameters with the help of PSO and optimization techniques. However, the high computational cost of PSO is another issue with the approach. Likewise, Dhanabal and Shantharajah (2015) [23] applied J48, SVM and Naive Bayes, and obtained accuracy of 98.88%, 95.2%, and 73.32%, respectively. The results obtained have highlighted the significance of model selection based on the nature of the dataset: simple classifiers like Naive Bayes cannot deal with high-dimensional and more complex datasets. The work of Manzoor and Kumar (2017) [24], who used artificial neural networks (ANNs) on the KDD'99 dataset, showed an accuracy of 97.91%. While ANNs can learn sophisticated patterns of data, the lack of an appropriate feature selection and optimization tool may cause overfitting and the increase in training time needed. Meanwhile, Moukhafi et al. (2018) [25] used a hybrid approach with the combination of genetic algorithms (GA) and SVM technique and got an accuracy of 96.38%. This implies that, sometimes, the combination of GA and SVM is not effective because the optimization provided by GA can be offset by the drawbacks of SVM regarding the processing of big and noisy feature space. Iwendi et al. [26] worked in 2020 and used ensemble methods including Bagging and AdaBoost on the KDD'99 dataset with an impressive accuracy of 99.4%. Generally, ensemble methods improve robustness and decrease variance due to several weak learners. However, the process is computationally expensive and requires proper management of base models to prevent overfitting. The maximum accuracy rate of 99.54% was obtained by employing the hybrid CNN-LSTM method on the NSL-KDD dataset, according to El-Sayed et al. [27]. This methodology uses the capability of feature extraction offered by CNNs along with the power of LSTMs to build relationships between time frames; hence, it can detect complex attacks. Nevertheless, deep models like the CNN-LSTM structure require high computation power and may not be generalized easily without fine-tuning and large training datasets. In the proposed research, PSO will be used for feature selection and hyperparameters tuning of a multi-layer DNN and obtains 99.05% accuracy for the KDD'99 dataset. While the proposed system is slightly less effective than some ensemble and deep learning models, it still provides a reasonable balance between performance and computational complexity. This allows PSO to dynamically explore feature spaces and optimal neural network architecture without increasing computation complexity, unlike the complex structures like the CNN-LSTM structure.

Table 7. Comparison of related work with proposed work.

Paper

Classification Technique

Dataset

Accuracy Rate (%)

Li et al., 2012 [21]

SVM

KDD ’99

98.62

Saxena and Richariya 2014 [22]

Hybrid PSO-SVM Approach

KDD ’99

99.4

Dhanabal and Shantharajah 2015 [23]

J48, SVM, and Naive Bayes

KDD ’99

98.88, 95.2, 73.32

Manzoor and Kumar 2017 [24]

Based on ANN

KDD ’99

97.91

Moukhafi et al., 2018 [25]

Hybrid technique: GA and SVM

KDD ’99

96.38

Iwendi et al., 2020 [26]

Bagging and AdaBoost classifier

KDD ’99

99.4

Elsayed et al., 2024 [27]

Hybrid CNN-LSTM architecture

NSL-KDD

99.54

Proposed work

PSO-ML-DNN

KDD ’99

99.05%

  1. Benchmark Validation of PSO Search Behaviour

For the further analysis of search algorithm used by PSO prior to its use in the PSO-DNN detection system, a function benchmark test was carried out using six functions, which include Sphere, Rosenbrock, Rastrigin, Ackley, Griewank, and Schwefel. The choice of such functions is justified by the presence of various kinds of optimization problems, which can be represented by smooth unimodal surfaces, nonlinear valleys, multimodal landscapes, and complicated functions with a lot of local minima. The function test has been made using 30 particles, 100 iterations, 30 dimensions, and 20 independent experiments. The goal of the test was not to prove that PSO is better than other optimization algorithms but to study its convergence behavior.

The visualization of the optimization surface is done using Figure 5, which displays the three-dimensional surfaces of some benchmark functions. The Sphere function shows the simplicity and smoothness of the unimodal surface, while the Rosenbrock function portrays a narrow valley structure that is harder for an optimizer to explore effectively. The Rastrigin function exhibits a highly multimodal surface with many local minima, while the Ackley function has a complicated basin structure that is made up of several variations in the local area of the global optimum.

(a) Sphere

(b) Rosenbrock

(c) Rastrigin

(d) Ackley

Figure 5. Three-dimensional surfaces of selected benchmark functions used for PSO validation

Convergence of PSO algorithm after 100 iterations is shown in Figure 6. Convergence analysis demonstrates that PSO converges to better solutions as the number of iterations grows since swarm particles are becoming closer to the good solution regions. There is a clear tendency of decreasing fitness value for Rosenbrock function during initial iterations and then stabilizing. This indicates that there is a move from the exploration to exploitation stage of the optimization process. Lower fitness values are achieved on benchmark functions Ackley and Griewank which have relatively low complexity. Meanwhile, Rosenbrock and Schwefel are still considered difficult due to the shape of the valley and high modality, correspondingly.

Table 5 displays the numerical benchmarks results obtained from 20 random runs. The results show that the PSO algorithm gave the best fitness value means for the Griewank and Ackley, where the mean fitness values were 5.4944 and 6.3684, respectively. The performance of Rastrigin was acceptable in terms of convergence for this multimodal problem, since the mean value was 122.68. However, the Rosenbrock and Schwefel functions showed relatively high mean and standard deviations; this proves the complexity of these two functions. This result is not surprising, considering the fact that Rosenbrock has a narrow-valley function and Schwefel is complex and highly multimodal.

Figure 7 compares the mean final fitness values obtained by PSO across the benchmark functions. The comparison confirms that PSO performs more effectively on Ackley and Griewank, while Rosenbrock and Schwefel are the most difficult functions in the tested group. This variation confirms that the performance of PSO is strongly affected by the structure of the optimization landscape. Therefore, in the proposed IDS framework, PSO is used as a practical optimization mechanism to reduce redundant features and tune DNN parameters, rather than as a universal optimizer for all possible mathematical landscapes.

Figure 6. PSO convergence behaviour on benchmark functions

Table 8. PSO benchmark validation results over 20 independent runs

Benchmark Function

Best Value

Mean Value

Std. Dev.

Worst Value

Sphere

51.262

473.62

312.13

1181.8

Rosenbrock

10502

1.0898

79959

3.0937

Rastrigin

54.163

122.68

62.177

277.04

Ackley

3.737

6.3684

1.6115

9.615

Griewank

2.5151

5.4944

3.0898

13.789

Schwefel

3878.3

5017.2

972.58

7470.6

Standard deviation of final fitness value for each of the 20 runs is shown in Figure 8. For Ackley and Griewank, the low standard deviation means that there is less variation among their results, which implies better convergence properties. The high standard deviation for Rosenbrock and Schwefel is due to the variations between their results. Such variations are dependent on the intricacy of the problem domain, and local minima which may affect the movement of the swarm. Finally, the test results have shown that PSO is a reliable search method and can therefore be considered for feature selection and DNN hyperparameter tuning.

In conclusion, it can be stated that the benchmark testing proves that the PSO has good convergence properties for various types of search spaces. Even though there is a performance difference for more complicated benchmark functions, the optimizer is still appropriate for the function required for this research, which involves detecting the informative features and improving the DNN configuration.

Figure 7. Final PSO fitness values across benchmark functions

Figure 8. Stability analysis of PSO over independent runs

  1. Comparative Performance Analysis of the Proposed PSO-DNN Model

The performance of the proposed PSO-DNN framework was further analysed by comparing the training and testing results in terms of accuracy, sensitivity, and specificity. As shown in Figure 9, the model achieved closely matched training and testing performance, with training accuracy, sensitivity, and specificity values of 99.29%, 99.22%, and 99.43%, respectively. During testing, the model maintained strong generalization ability, achieving 99.05% accuracy, 99.31% sensitivity, and 99.01% specificity. The small difference between the training and the testing results indicates that the current model was able to learn representative traffic patterns without showing a significant overfitting effect.

In order to get more insights into the performance of the proposed algorithm, the performance of the tests was also analysed for various types of traffic such as normal, DoS, Probe, U2R, and R2L. Figure 10 demonstrates that the performance of the proposed framework was consistent for all the tested classes. The maximum accuracy in the case of the DoS class was 99.34%, where the sensitivity and specificity were 99.31% and 99.20%, respectively. Traffic belonging to the normal class was detected accurately with an accuracy of 99.19%, and the accuracy in the case of R2L attacks was 99.01%.

Ultimately, the findings derived from the comparative study demonstrate that the suggested PSO-DNN algorithm performs consistently when it comes to attack detection. Consistency of the metrics used in both phases of training and testing is indicative of a high degree of generalization; on the other hand, class-wise comparison indicates that the algorithm demonstrates an exceptional capacity for attack detection in all types.

The class-wise radar profile of the PSO-DNN model has been presented in Figure 11, which consists of three evaluation parameters: accuracy, sensitivity, and specificity. The radar diagram shows the model’s performance comparison through the five traffic classes: Normal, DoS, Probe, U2R, and R2L. It is seen from the results that the model performs a uniform detection performance level for all traffic classes, where DoS attains the maximum value of accuracy as 99.34%, followed by Normal traffic with 99.19% accuracy and R2L with 99.01% accuracy. However, while the other two classes have low accuracy, yet they attain values greater than 98%, making it clear that the framework is capable of detecting all kinds of attacks, whether common or challenging.

Figure 9. Training and testing performance comparison of the proposed PSO-DNN model

Figure 10. Class-wise testing performance of the proposed PSO-DNN model across normal and attack categories

Figure 11. Class-wise radar plot of the proposed PSO-DNN model

  1. DISCUSSION

The proposed PSO-DNN framework investigates the integration of feature selection and hyperparameter optimization to improve network intrusion detection using the NSL-KDD dataset. The originally reported testing accuracy of 99.05% indicates promising classification performance, although this result requires verification against the confusion matrix and class-specific metrics. The integration of PSO aims to reduce redundant attributes and identify suitable DNN configurations, potentially improving predictive performance and model complexity. However, classification accuracy alone is insufficient to establish the effectiveness of the optimization process, particularly when minority attack categories are underrepresented.

Previous studies have demonstrated the potential of metaheuristic optimization in intrusion detection. Srilatha and Thillaiarasu [29] reported 99.81% accuracy using PSO-assisted feature selection and deep learning on CICIDS2017. Similarly, Alghamdi and Alotaibi [31] achieved 99.81% accuracy using pigeon-inspired optimization and neural classification, while Srinivasa Rao et al. [34] reported 98.98% accuracy using African Buffalo Optimization and an echo-state network. More recently, Araújo et al. [38] combined Ant Colony Optimization and convolutional neural networks, achieving a reported DDoS detection F1-score of 97.0%. These findings support the relevance of optimization-assisted classifiers. Nevertheless, direct superiority claims are inappropriate because the studies employ different datasets, preprocessing procedures, and evaluation protocols. Therefore, the contribution of the proposed framework must be established through controlled comparisons with conventional DNNs and alternative optimization methods. These results validate the applicability of optimization-assisted classifiers. However, any assertions about superiority are unjustified since the experiments use different data sets, pre-processing steps, and validation criteria. Thus, the contribution of the proposed architecture should be justified via controlled experiments involving traditional DNNs and other optimization algorithms.

It is essential to consider the impact of feature selection and hyperparameter optimization on performance efficiency. While feature selection can lower the number of input variables and consequently decrease the complexity of DNN training, PSO creates an extra load due to multiple fitness function calculations. Furthermore, PSO convergence depends on population size, iteration budget, search-space dimensionality, and optimization parameters. Consequently, classification improvements do not necessarily demonstrate successful convergence or reduced total computational cost. Comparisons with deterministic feature selection and random search, together with convergence analysis and execution-time measurements, are essential for demonstrating the practical advantages of the proposed approach.

The reliability of intrusion detection also depends on performance across individual attack classes. There is severe class imbalance for U2R and R2L attacks in NSL-KDD, which might cause poor performance in detecting minority classes even if there is high classification accuracy. In this context, measures like precision, recall, macro F1 score, and confusion matrices should be added to general classification performance metrics. Current research works using graph theory and optimization-based structures [40]-[43] have shown the wide variety of methodologies used in order to detect complex traffic behaviors in networks.

Moreover, recent studies have also shown that the use of optimization algorithms is significant in the performance enhancement of intelligent systems. For instance, Basil et al. [49] have conducted comparative analyses of LSTM, HHOSOA, COAESPSO, and XGBoost models, focusing on predicting accuracy and efficiency. On a similar note, Idris et al. [50] have conducted research work on PSO, PSO assisted by reinforcement learning, and Multi-Objective PSO on resource allocation in wireless networks, highlighting the significance of convergence, robustness, and computational aspects.

Limitations associated with the representativeness of the dataset, stability of the optimization process, and application of the model in practice are also present in the study. First, the NSL-KDD database does not capture current protocols for IoT systems as well as the latest methods used for DDoS attacks. Second, the appropriateness of the algorithm to work in resource-limited conditions can only be proven with the help of measuring the time of inference, memory usage, and processing power required for classification. In order to prove the scientific value of the PSO-DNN algorithm, future studies should consider other datasets such as CICIoT2023.

  1. CONCLUSIONS

This paper presented a hybrid PSO-DNN intrusion detection framework for reliable DDoS attack detection using the NSL-KDD benchmark dataset. The proposed framework was designed to overcome several limitations commonly associated with conventional IDS models, including feature redundancy, manual hyperparameter selection, overfitting, and limited adaptability to complex network attack patterns. The process involves a series of steps involving data preprocessing and optimization like normalization, standardization, elimination of redundant features, PSO feature selection, PSO hyperparameter optimization and finally, classification using multilayered DNN with dropouts and batch normalization. From the experiments carried out, it was evident that the new architecture exhibited strong and stable detection performance. The algorithm attained an accuracy of 99.29% in the training phase and 99.05% in the testing phase while the testing sensitivity and specificity were at 99.31% and 99.01%, respectively. From the results, there is a clear agreement between training and testing results, hence indicating that the algorithm exhibits no signs of overfitting. Furthermore, from class-wise analysis, the proposed framework showed good performance across all traffic classes like Normal, DoS, Probe, U2R, and R2L traffic. In order to prove the efficacy of the optimization phase of the suggested approach, PSO algorithm was tested on well-known benchmarking functions for optimization which have different features of search spaces. The benchmarking results indicated acceptable convergence behavior and stable search performance on various landscapes. While difficult functions such as Rosenbrock and Schwefel function were still tough to optimize, the benchmarking proved that the use of PSO is quite appropriate for selecting informative features and optimizing the hyperparameters of DNN. Overall, it has been proven that the combination of PSO-based optimization with DNN-based classification improves IDS models' reliability and generalization ability. The proposed PSO-DNN framework provides a promising cybersecurity solution for DDoS attack detection in IoT-oriented network environments. Future work will focus on validating the framework using more recent and large-scale intrusion detection datasets, testing its performance under real-time traffic conditions, and developing lightweight adaptive optimization strategies suitable for deployment in resource-constrained IoT systems.

DECLARATION

Author Contribution

All authors contributed equally to the main contributor to this paper. All authors read and approved the final paper.

Funding

This research received no external funding

Conflicts of Interest

The authors declare no conflict of interest.

REFERENCES

  1. F. C. Ogenyi et al., “Transforming digital health using the Internet of Things for personalized, interoperable, and secure healthcare systems,” Discov. Health Syst., vol. 5, p. 20, 2026, https://doi.org/10.1007/s44250-026-00359-2.
  2. S. Joshi, A. Baviskar, and S. Rajmane, “A review of cybersecurity in smart cities and intelligent transport systems,” Discov. Internet Things, vol. 6, p. 41, 2026, https://doi.org/10.1007/s43926-026-00312-y.
  3. R. Mohawesh et al., “Cybersecurity challenges and solutions in 5G-enabled Internet of Things,” Discov. Comput., vol. 29, p. 29, 2026, https://doi.org/10.1007/s10791-026-09926-w.
  4. K. Tange, M. De Donno, X. Fafoutis, and N. Dragoni, “A systematic survey of industrial Internet of Things security: Requirements and fog computing opportunities,” IEEE Commun. Surv. Tutor., vol. 22, no. 4, pp. 2489–2520, 2020, https://doi.org/10.1109/COMST.2020.3011208.
  5. M. Alauthman et al., “Generative adversarial networks for intrusion detection systems: A comprehensive survey of applications, challenges, and research directions,” Arab. J. Sci. Eng., vol. 51, pp. 179–203, 2026, https://doi.org/10.1007/s13369-026-11103-6.
  6. P. Williams, I. K. Dutta, H. Daoud, and M. Bayoumi, “A survey on security in Internet of Things with a focus on the impact of emerging technologies,” Internet Things, vol. 19, p. 100564, 2022, https://doi.org/10.1016/j.iot.2022.100564.
  7. V. Demertzi, S. Demertzis, and K. Demertzis, “An overview of cyber threats, attacks and countermeasures on the primary domains of smart cities,” Appl. Sci., vol. 13, no. 2, p. 790, 2023, https://doi.org/10.3390/app13020790.
  8. E. Schiller, A. Aidoo, J. Fuhrer, J. Stahl, M. Ziörjen, and B. Stiller, “Landscape of IoT security,” Comput. Sci. Rev., vol. 44, p. 100467, 2022, https://doi.org/10.1016/j.cosrev.2022.100467.
  9. G. Kaur, K. Singh, P. Bhambri, and S. K. Singla, “Securing the Hyper‐Connected World: Security, Privacy and Research Challenges in IoT,” Edge Intelligence for 6G‐Enabled Industrial Internet of Things, pp. 271-284, 2026, https://doi.org/10.1002/9781394305414.ch13.
  10. M. Alawida, A. E. Omolara, O. I. Abiodun, and M. Al-Rajab, “A deeper look into cybersecurity issues in the wake of COVID-19: A survey,” J. King Saud Univ. Comput. Inf. Sci., vol. 34, no. 10, pp. 8176–8206, 2022, https://doi.org/10.1016/j.jksuci.2022.08.003.
  11. Ö. Aslan, S. S. Aktuğ, M. Ozkan-Okay, A. A. Yilmaz, and E. Akin, “A comprehensive review of cyber security vulnerabilities, threats, attacks, and solutions,” Electronics, vol. 12, no. 6, p. 1333, 2023, https://doi.org/10.3390/electronics12061333.
  12. A. Javadpour, F. Ja’fari, T. Taleb, M. Shojafar, and C. Benzaïd, “A comprehensive survey on cyber deception techniques to improve honeypot performance,” Comput. Secur., vol. 140, p. 103792, 2024, https://doi.org/10.1016/j.cose.2024.103792.
  13. A. Khraisat, I. Gondal, P. Vamplew, and J. Kamruzzaman, “Survey of intrusion detection systems: Techniques, datasets and challenges,” Cybersecurity, vol. 2, no. 1, pp. 1–22, 2019, https://doi.org/10.1186/s42400-019-0038-7.
  14. R. Kaur, D. Gabrijelčič, and T. Klobučar, “Artificial intelligence for cybersecurity: Literature review and future research directions,” Inf. Fusion, vol. 97, p. 101804, 2023, https://doi.org/10.1016/j.inffus.2023.101804.
  15. T. Sowmya and E. M. Anita, “A comprehensive review of AI based intrusion detection system,” Meas. Sens., vol. 28, p. 100827, 2023, https://doi.org/10.1016/j.measen.2023.100827.
  16. O. S. Younes, “A hybrid deep learning model for detecting DDoS flooding attacks in SIP-based systems,” Comput. Netw., vol. 240, p. 110146, 2024, https://doi.org/10.1016/j.comnet.2023.110146.
  17. Z. Ahmad, A. S. Khan, C. W. Shiang, J. Abdullah, and F. Ahmad, “Network intrusion detection system: A systematic study of machine learning and deep learning approaches,” Trans. Emerg. Telecommun. Technol., vol. 32, no. 1, p. e4150, 2021, https://doi.org/10.1002/ett.4150.
  18. Y. Zhang, R. C. Muniyandi, and F. Qamar, “A review of deep learning applications in intrusion detection systems: Overcoming challenges in spatiotemporal feature extraction and data imbalance,” Appl. Sci., vol. 15, no. 3, p. 1552, 2025, https://doi.org/10.3390/app15031552.
  19. Y. Sanjalawe et al., “A review of artificial intelligence-based intrusion detection in industrial Internet of Things,” Discov. Internet Things, vol. 6, p. 44, 2026, https://doi.org/10.1007/s43926-026-00285-y.
  20. M. Tavallaee, E. Bagheri, W. Lu, and A. A. Ghorbani, “A detailed analysis of the KDD CUP 99 data set,” in Proc. IEEE Symp. Comput. Intell. Secur. Defense Appl. (CISDA), pp. 1–6, 2009, https://doi.org/10.1109/CISDA.2009.5356528.
  21. S. M. Kasongo and Y. Sun, “Performance analysis of intrusion detection systems using a feature selection method on the UNSW-NB15 dataset,” J. Big Data, vol. 7, p. 105, 2020, https://doi.org/10.1186/s40537-020-00379-6.
  22. C. Iwendi et al., “The use of ensemble models for multiple class and binary class classification for improving intrusion detection systems,” Sensors, vol. 20, no. 9, p. 2559, 2020, https://doi.org/10.3390/s20092559.
  23. I. Cvitić, D. Peraković, B. B. Gupta, and K.-K. R. Choo, “Boosting-based DDoS detection in Internet of Things systems,” IEEE Internet Things J., vol. 9, no. 3, pp. 2109–2123, 2022, https://doi.org/10.1109/JIOT.2021.3090909.
  24. M. Ahsan et al., “Cybersecurity threats and their mitigation approaches using machine learning—A review,” J. Cybersecur. Priv., vol. 2, no. 3, pp. 527–555, 2022, https://doi.org/10.3390/jcp2030027.
  25. T. A. Al Ibaisi, S. Kuhn, M. Kaiiali, and M. Kazim, “Network intrusion detection based on amino acid sequence structure using machine learning,” Electronics, vol. 12, no. 20, p. 4294, 2023, https://doi.org/10.3390/electronics12204294.
  26. M. Nakıp and E. Gelenbe, “Online self-supervised deep learning for intrusion detection systems,” IEEE Trans. Inf. Forensics Secur., vol. 19, pp. 5668–5683, 2024, https://doi.org/10.1109/TIFS.2024.3402148.
  27. E. Gelenbe, B. C. Gul, and M. Nakıp, “DISFIDA: Distributed self-supervised federated intrusion detection algorithm with online learning for health Internet of Things and Internet of Vehicles,” Internet Things, vol. 28, p. 101340, 2024, https://doi.org/10.1016/j.iot.2024.101340.
  28. A. N. Jaber, M. F. Zolkipli, H. A. Shakir, and M. R. Jassim, “Host based intrusion detection and prevention model against DDoS attack in cloud computing,” Lect. Notes Data Eng. Commun. Technol., vol. 13, pp. 241–252, 2018, https://doi.org/10.1007/978-3-319-69835-9_23.
  29. D. Srilatha and N. Thillaiarasu, “DDoSNet: A deep learning model for detecting network attacks in cloud computing,” in Proc. 4th Int. Conf. Invent. Res. Comput. Appl. (ICIRCA), pp. 576–581, 2022, https://doi.org/10.1109/ICIRCA54612.2022.9985524.
  30. A. G. Nagesha, G. Mahesh, and Gowrishankar, “Intelligent feature subset selection with machine learning based detection and mitigation of DDoS attacks in 5G environment,” J. Interconnect. Netw., vol. 22, 2022, https://doi.org/10.1142/S0219265921410322.
  31. T. A. Alghamdi and S. S. Alotaibi, “Internet of Things enabled DDoS attack detection using pigeon inspired optimization algorithm with deep learning approach,” Comput., Mater. Contin., vol. 80, no. 3, pp. 4047–4064, 2024, https://doi.org/10.32604/cmc.2024.052796.
  32. D. Tikhe, P. Deshpande, P. Wani, J. Mante, and K. Kolhe, “Leveraging metaheuristic algorithms for optimal feature selection in IoT cybersecurity: A study on enhancing DDoS attack detection,” in Proc. 8th Int. Conf. Comput., Commun., Control Autom. (ICCUBEA), 2024, https://doi.org/10.1109/ICCUBEA61740.2024.10774813.
  33. S. Anusooya, N. Revathi, P. Sivakamasundari, A. N. Duraivel, and S. Prabu, “A hybrid genetic algorithm and neural network-based cyber security approach for enhanced detection of DDoS and malware attacks in wide area networks,” J. Cybersecur. Inf. Manage., vol. 14, no. 2, pp. 253–262, 2024, https://doi.org/10.54216/JCIM.140217.
  34. G. S. Rao et al., “DDoSNet: Detection and prediction of DDoS attacks from realistic multidimensional dataset in IoT network environment,” Egypt. Inform. J., vol. 27, p. 100526, 2024, https://doi.org/10.1016/j.eij.2024.100526.
  35. J. Jeyaboopathiraja, P. Mariajohn, S. S. Maidin, and J. Sun, “An adaptive Cuckoo Search algorithm with deep learning for addressing cyber security problem,” J. Appl. Data Sci., vol. 5, no. 4, pp. 1977–1988, 2024, https://doi.org/10.47738/jads.v5i4.366.
  36. P. Radhika and S. Kamalakkannan, “Deep learning model with optimization strategies for DDoS attack detection in cloud computing,” in Proc. 3rd Int. Conf. Intell. Data Commun. Technol. Internet Things (IDCIoT), pp. 413–417, 2025, https://doi.org/10.1109/IDCIOT64235.2025.10914724.
  37. K. M. Salunke and S. Kurumbanshi, “An enhanced hybrid approach for real-time application-layer DDoS detection and resilience in MANET environments,” SSRG Int. J. Electron. Commun. Eng., vol. 12, no. 7, pp. 305–314, 2025, https://doi.org/10.14445/23488549/IJECE-V12I7P124.
  38. A. R. C. Araújo, R. L. Rosa, D. Z. Rodríguez, S. S. Maidin, J. B. Awotunde, and M. Saadi, “Lightbioptimum: An intrusion detection system based on bio-inspired algorithm for VANET,” Trans. Emerg. Telecommun. Technol., vol. 36, no. 10, p. e70254, 2025, https://doi.org/10.1002/ett.70254.
  39. B. H. Swathi et al., “Securing 5G-enabled cyber-physical systems: An optimized reflection equivariant quantum neural network approach to DDoS attack detection,” in Proc. 3rd Int. Conf. Self Sustain. Artif. Intell. Syst. (ICSSAS), pp. 606–612, 2025, https://doi.org/10.1109/ICSSAS66150.2025.11080985.
  40. M. B. Begum, Y. A., N. R. Nagarajan, and P. Rajalakshmi, “Dynamic network security leveraging efficient CoviNet with Granger causality-inspired graph neural networks for data compression in cloud IoT devices,” Knowledge-Based Syst., vol. 309, p. 112859, 2025, https://doi.org/10.1016/j.knosys.2024.112859.
  41. B. Jyothsna and V. Jyothsna, “Design of an improved model for DDoS mitigation in SDN-IoT using TGNN, QAOA, and the federated adversarial learning process,” Eng. Technol. Appl. Sci. Res., vol. 15, no. 6, pp. 29056–29061, 2025, https://doi.org/10.48084/etasr.12295.
  42. R. S. Devi, R. Bharathi, and P. K. Kumar, “Quantum-enhanced IoT security against DDoS attacks integrating piecewise Gazelle Optimization and graph neural networks,” Iran. J. Sci. Technol., Trans. Electr. Eng., vol. 49, no. 4, pp. 1711–1733, 2025, https://doi.org/10.1007/s40998-025-00868-5.
  43. A. K. Dubey, S. Kaswan, V. Pathak, and L. N. Sahu, “Enhancing cloud security against distributed denial of service attacks using quantum Lorentz-equivariant graph neural network with circle-inspired optimization in 6G networks,” in Proc. 2nd IEEE Int. Conf. Women Comput. (InCoWoCo), 2025, https://doi.org/10.1109/InCoWoCo68239.2025.11407216.
  44. S. M. B. Alsabti et al., “Hybrid quantum-inspired optimization and convolutional neural networks for scalable DDoS detection in IoT networks,” in Proc. Int. Conf. Smart Multidomain Integr. Learn. Environ. (ICSMILE), 2026, https://doi.org/10.1109/ICSMILE69273.2026.11519108.
  45. F. W. Wibowo and Wihayati, “BISECANN-CLEO for DDoS attack classification in network intrusion detection,” in Proc. 5th Int. Conf. Electron. Represent. Algorithm (ICERA), pp. 431–437, 2026, https://doi.org/10.1109/ICERA72709.2026.11666740.
  46. H. Askr, M. Abdel-Salam, and A. E. Hassanien, “Neural sentinels: A Quasi-Quantum hiking optimization based deep feature selection system for robust IoT-metaverse intrusion detection,” Knowledge-Based Syst., vol. 353, p. 117103, 2026, https://doi.org/10.1016/j.knosys.2026.117103.
  47. A. Sharma and P. Saxena, “Distributed denial of service attack detection and prevention using Pipit Fox-attentional deep learning in software-defined networking,” Int. J. Image Graph., vol. 26, no. 4, 2026, https://doi.org/10.1142/S0219467826500294.
  48. M. Sreenivasu, M. Sreenivasu, and K. Sudeesh, “Intelligent DDoS detection in software-defined networks using graph neural networks with Grasshopper Optimization,” in Proc. Int. Conf. Circuit, Power Comput. Technol. (ICCPCT), pp. 376–381, 2026, https://doi.org/10.1109/ICCPCT70290.2026.11654909.
  49. N. Basil, N. Cherif, M. B. Alhamadani, H. Hasan, and T. F. Agajie, “Comparative analysis of LSTM, HHOSOA, COAESPSO, and XGBoost models for time series load forecasting,” Int. J. Comput. Eng. Artif. Intell., vol. 1, no. 1, 2026, https://ijceai.org/index.php/ijceai/article/view/13.
  50. S. Idris, M. M. Sa'ad, R. H. Origi, N. Faruk, A. H. Jabire, and M. A. Abana, “Pareto-optimal resource allocation for multi-user wireless networks: A comparative study of PSO, reinforcement learning, and MOPSOs,” Int. J. Smart Control Electr. Eng. Syst., vol. 1, no. 2, 2026, https://ijscees.org/index.php/pub/article/view/12.

Israa Nadheer (A Hybrid PSO-Optimized Deep Neural Network Framework for Reliable DDoS Attack Detection in IoT-Oriented Intrusion Detection Systems)