1. Introduction
The Internet of Things (IoT) has revolutionised connectivity by linking devices, people and processes, driving transformation across numerous industries [
1,
2]. However, this widespread connectivity has brought significant security challenges, particularly given the vulnerabilities associated with resource-constrained IoT devices and their deployment in insecure environments [
3,
4]. The convergence of IoT and artificial intelligence (AI) has given rise to the Artificial Intelligence of Things (AIoT), introducing both opportunities and challenges in cybersecurity [
5,
6,
7]. Intrusion-detection systems (IDSs) play an essential role in protecting IoT and AIoT networks by identifying and mitigating potential cyber risks [
8]. However, many existing IDSs struggle to maintain a balance between computational efficiency and detection accuracy, especially in real-time AIoT environments [
9,
10,
11].
To optimise IDS performance, feature selection is critical, as it reduces data dimensionality [
12,
13], streamlines processing, and enhances classification accuracy [
14,
15]. By focusing on the most relevant features, IDSs can operate more effectively, especially in resource-limited AIoT ecosystems, such as edge-based IoT devices. Advanced machine learning (ML) and deep learning (DL) techniques have further improved the capabilities of IDSs, enabling them to process large datasets and detect complex patterns in network traffic [
16,
17]. However, identifying the optimal features and integrating them with cutting-edge classifiers remains a key challenge in achieving robust and scalable AIoT security solutions [
14,
18]. Unlike previous studies that typically applied feature selection or PCA separately, our study introduced a novel integration of multiple feature selection methods (CFS, Pearson, GR, IG and SU) combined with PCA, evaluated across advanced DL classifiers (ANN, DNN and TabNet) and specifically tailored to AIoT security, to achieve state-of-the-art accuracy.
This study built upon our previous work on IoT network intrusion detection, in which we demonstrated the effectiveness of feature selection methods in improving classification performance [
19]. In the current work, we expanded this by specifically addressing AIoT security challenges and introducing a novel integration of multiple feature selection methods with principal component analysis (PCA) and advanced deep learning classifiers to optimise both computational efficiency and detection accuracy. Specifically, we evaluated DL-based classification models to determine their effectiveness in detecting anomalies and securing AIoT networks. By comparing these models’ classification performance, deeper insights are provided into the trade-offs between model complexity and detection accuracy in AIoT security.
This study aimed to evaluate the effectiveness of certain features in accurately distinguishing between normal and abnormal network traffic. This was performed by applying selected features in classification tasks using DL models, such as artificial neural networks (ANNs), deep neural networks (DNNs) and TabNet, analysing network traffic patterns and correlating them with different types of attacks. The novelty of our approach lies in its integration of multiple feature selection methods (CFS, Pearson, GR, IG and SU) with principal component analysis (PCA), achieving state-of-the-art accuracy (99.7%) with ANN. Furthermore, we identified critical features correlated with attack patterns, providing enhanced insights for practical implementation in AIoT environments.
The findings of this research contribute to the ongoing development of efficient, scalable IDS frameworks tailored to AIoT environments. By demonstrating the potential of combining feature selection techniques with advanced classifiers, this study offers insights into enhancing the resilience of AIoT networks against evolving cyber threats.
The remainder of this paper is organised as follows:
Section 2 reviews related works on feature selection and classification for IoT security.
Section 3 details the methodology used in this study to achieve the research aim, including the feature selection techniques and classification models.
Section 4 presents the results.
Section 5 discusses the findings and their implications for IoT security.
Section 6 concludes the study and outlines future research directions.
2. Related Works
Significant attention is being paid to the deployment of ML and DL methods to uncover patterns and associations in datasets [
20]. In this section, we briefly discuss the works that have exploited learning algorithms for IDSs, which we consulted in developing the proposed approach. Several studies have explored IDSs for which many learning methods were explored, such as feed-forward neural networks (FNNs), convolutional neural networks (CNNs), long short-term memory (LSTMs) networks and ensemble algorithms.
In Soltani, M., et al. [
21], multi-agent adaptive DL models for detecting intrusion were constructed to address challenges such as traffic concept drift and distributed architecture. Two DL algorithms were utilised: CNN and LSTM. The proposed approach achieved a satisfactory accuracy of 95%. Generally, this work highlights the usefulness of applying DL models in developing practical early anomaly detection.
Sajid et al. [
22] proposed a hybrid ML–DL method to enhance intrusion detection. The model combines extreme gradient boosting and CNN to extract important variables, followed by LSTM for classification. The results of the proposed model demonstrated high detection rates and superior accuracy (98.4%) with a low false acceptance rate.
Kanna, P.R. and Santhi, P in [
23] proposed a DL model-optimised CNN and hierarchical multiscale LSTM (HMLSTM) for anomaly detection. They performed lion swarm optimisation, CNN and HMLSTM. They tested this approach using three benchmark datasets: NSL-KDD, ISCX-IDS and UNSWNB15. The model achieved 90.67% accuracy. However, the model was proposed only for binary classification. The study highlighted the importance of moving towards anomaly detection methods rather than relying only on signature-based approaches to improve intrusion detection.
Henry et al. [
24] focused on improving network intrusion detection using a hybrid DL model and feature optimisation. They proposed the use of CNN and a gated recurrent unit (GRU) to improve network parameters, which helps significantly in anomaly detection using a network dataset. A remarkable 98.73% accuracy in detecting network behaviour was achieved. Thus, the authors concluded that DL techniques are efficient for classifying network behaviour.
The authors in [
25] addressed data imbalance in the DL algorithm’s detection performance by applying a focal loss function combined with FNN and CNN classifiers to enable the model to focus on challenging, misclassified instances. Their proposed model showed higher accuracy and better precision than advanced methods such as CNN–bidirectional LSTM and PB-DID.
In [
26], the authors introduced the improved LSTM (ILSTM) algorithm, which demonstrated notable enhancements to the standard LSTM algorithm by combining the chaotic butterfly optimisation algorithm and the particle swarm optimisation algorithm. The ILSTM algorithm is designed for binary and multiclass intrusion detection. Compared with other DL models, it achieved a relatively high accuracy score of 93.09%.
Various recent studies have used several ML and DL algorithms to enhance intrusion detection [
27,
28,
29,
30,
31]. Other studies have employed feature selection with DL to enhance the prediction of network behaviour [
32,
33,
34]. The experimental results from the IoT datasets demonstrated the usefulness of the proposed methods in improving the accuracy of malicious data detection. The current study extended these works by proposing a broad model for exploring the performance of a significant number of learning algorithms using feature selection methods.
Jia et al. [
35] introduced a federated learning approach, the Federated Dynamic Gravitational Search Algorithm (Fed-DGSA), for distributed IoT intrusion detection. Their decentralised model reached approximately 97.8% accuracy, highlighting federated learning’s potential to enhance security in distributed AIoT networks.
Ferrag et al. [
36] provided the Edge-IIoTset, a comprehensive IoT and IIoT cybersecurity dataset. They evaluated various ML and DL models, demonstrating a deep neural network that achieved around 94.67% accuracy; their top-performing model, Random Forest, reached about 99% accuracy and F1-score, underlining the effectiveness of classical ML methods as well as deep learning for IoT security.
Table 1 summarises and compares the reviewed intrusion detection studies in terms of datasets, methods and reported accuracy.
4. Results
Using the open-source RT-IoT2022 dataset to collect network traffic data from various real-time IoT devices, this study encompassed 123,117 instances. It aimed to correctly examine event-related data to detect abnormal patterns and thus prevent crimes. To perform the experiments, the dataset was initially partitioned as follows: 70% as a training set and 30% as a testing set. All the performance metrics, including accuracy, precision, recall and the F1 score, were stated as percentages. In this section, we present an overview of the experimental results of this study, which assessed the performance of 33 predictive models. These models comprise three DL classifiers, five feature selection methods and PCA. As shown in
Figure 4 and
Table 5,
Table 6 and
Table 7, we compared the results of these models using only DL classifiers, feature selection methods with classifiers, and feature selection methods and PCA along with classifiers.
4.1. Experiments Using Only DL Classifiers
The performance results of the three DL classifiers before the application of the feature selection methods are presented in
Table 5. They showed that the DL classifiers performed differently. DNN had the lowest accuracy score (10.2%), as it relies on meaningful feature representations to learn complex patterns. High-dimensional input may present noise, making it harder for the model to extract relevant features and leading to poor generalisation.
ANN and TabNet performed similarly; they were able to classify instances effectively without the need to perform feature selection methods. TabNet achieved the highest accuracy among the three DL classifiers (94%), closely followed by ANN (92%).
4.2. Experiments Using Feature Selection Methods with DL Classifiers
The same classification algorithms were then deployed with feature selection methods. First, we deployed five feature selection algorithms: CFS, Pearson analysis, GR, IR and SU. We obtained 5, 32, 51, 45 and 60 features, respectively. The feature fwd_init_window_size’ was the most important feature in predicting network behaviour, and it appeared in all feature selection techniques.
Next, the classification algorithms were deployed using feature selection techniques.
Table 6 shows the performance of the selected classification methods with different feature selection techniques. ANN with the SU method achieved an accuracy score of 92.6%. For ANN, feature selection did not yield a notable improvement over using the full feature set. Although the accuracy of TabNet with CFS was significantly worse (63%) than that of TabNet alone, indicating a high number of misclassification cases, TabNet performed considerably better with the other feature selection methods. The feature subset from CFS might have restricted TabNet’s ability to learn the best feature interactions, leading to worse performance than TabNet without feature selection.
DNN models generally showed superior performance with feature selection methods. Notably, DNN with GR achieved an accuracy score of 99.5%. These models demonstrated significant performance with the use of stratified predictor variables.
4.3. Experiments Using Feature Selection Methods and PCA with DL Classifiers
We first compared the results of using PCA alone and PCA with one of five feature selection methods.
Figure 5 shows the cumulative variance of the first 10 principal components obtained using different feature selection methods. The figure shows better results from the use of PCA with feature selection methods than from the use of PCA alone. Specifically, the cumulative variance of the first 10 principal components was 74% when only PCA was used, but it reached 90.8% when PCA was used with the feature selection methods.
To investigate the results of using PCA and feature selection methods with DL classifiers, 15 models were generated. Their performance results are presented in
Table 7. They show that in almost all cases, PCA with the specified number of attributes performed best among all the experiments when used with DL methods. Specifically, PCA and Pearson analysis attained the highest accuracies using different classifiers but performed best with ANN, achieving not only 99.7% accuracy but also 99.6% precision, 99.7% recall and a 99.6% F1 score. The high precision and F1 score of this model indicate its ability to appropriately classify positive instances and attain a balance between precision and recall. The results also show that both ANN and DNN attained great results using PCA and different feature selection methods, with ANN reaching 99.5% accuracy using GR and SU, while DNN performed slightly better at 99.6% when using Pearson, GR and SU. These findings suggest that DNN and ANN benefit from PCA and feature selection methods and that both classifiers perform optimally with well-chosen feature subsets.
To evaluate the effect of class imbalance, we report the confusion matrix of the best- performing model to ensure that the model’s great accuracy is not simply due to predicting the majority class (normal). The results in
Table 8 show that the model achieved balanced performance across all classes, indicating that class imbalance did not significantly affect the model’s performance.
5. Discussion
The use of IoT systems in many fields, such as healthcare, various other industries and smart cities, involves continuous network connectivity and data sharing. Thus, network attackers could simply attack IoT devices and take advantage of any other device using the same network. The societal and economic implications of various types of network attacks necessitate intrusion prediction from both the public and economic viewpoints [
48].
Early detection of abnormal activities in a network can pave the way for timely interventions that potentially ban such activities. This not only reduces the risk of attacks but also bolsters users’ confidence in using IoT systems, reducing overall security costs. The current study provides evidence of the potential of ML and DL to enhance intrusion detection by offering an innovative methodology that combines the strengths of several predictive methods [
49].
In many practical scenarios, obtaining complete network activity data can be challenging. Thus, the first phase in constructing an effective IDS is selecting an appropriate and recent dataset. The dataset must include both normal and abnormal activities to simulate real-world activities. In this study, we used a standard dataset, RT-IoT2022. Developed in 2022, this dataset contains eight threats, including brute-force SSH attacks, DDoS attacks using Hping and Slowloris, and Nmap patterns. Its 83 attributes are used to differentiate normal from malicious communications [
39].
The choice of techniques was essential in this study to ensure solid intrusion detection performance. The selected techniques were ANN, DNN and TabNet. Their results are compatible with those of the latest studies, suggesting the potential of such techniques to aid in intrusion detection [
50,
51,
52].
Hybrid algorithms have steadily demonstrated strength in enhancing intrusion prediction by combining the power of multiple algorithms. In this study, a hybrid methodology was used via a model that synergises the strengths of feature selection, PCA and DL classifiers. Integrating feature selection with PCA led to a 5–8% accuracy improvement for ANN and TabNet while boosting DNN performance by around 90%.
The lower performance of TabNet with CFS (63%) may be attributed to the excessively aggressive feature reduction (selecting only five features), potentially omitting features essential for TabNet’s effective learning. Conversely, DNN substantially improved from 10.2% to 99.6% accuracy with GR due to the removal of redundant or noisy features, allowing the model to generalise better and reducing the risk of overfitting.
This methodology benefits from the different decision boundaries proposed by each method, thereby offering broad and comprehensive predictions.
The stark contrast between DNN’s poor performance on raw data (10.2% accuracy) and its superb performance with feature selection methods (reaching 99.6%) highlights the importance of dimensionality reduction in DL models. In addition, the model’s strength and robustness are attributable to its broad feature selection and validation processes. The use of feature selection methods based on feature importance not only enhances transparency in ML and DL classifications but also offers insights that can aid cybersecurity specialists in recognising and highlighting risk factors. Using different feature selection algorithms, we identified significant correlations between various network traffic features and specific types of attacks. Understanding these relationships is crucial for enhancing the effectiveness of IDSs, particularly in IoT environments where security vulnerabilities are prevalent.
In addition to classification accuracy improvements, this study contributes by explicitly identifying key network features (e.g., id.resp_p, service, fwd_init_window_size and flow_SYN_flag_count) that could serve as early indicators of intrusion in AIoT environments, aiding proactive and targeted security measures.
Reducing the number of features from 83 to a subset of 5–32 can significantly lower computational costs, leading to faster processing times and reduced memory usage. This reduction is particularly beneficial for real-time systems, where efficiency is crucial [
53].
The use of feature selection methods with PCA enhanced intrusion prediction in almost all cases. The results were particularly promising when Pearson analysis was used with PCA. This suggests that the classifiers’ performance is not always efficient when a large number of features are used, but all the classifiers had remarkable results when Pearson–PCA was used. Among the prediction models, Pearson–PCA with ANN performed best, with 99.7% accuracy. The achieved high accuracy (99.7%) is particularly significant, as it indicates that our proposed model closely approaches performance suitable for real-world AIoT deployments. However, achieving near-perfect accuracy in real-world conditions remains challenging due to evolving attack patterns and variability in network environments. This emphasises the necessity for the continuous updating and validation of models on new and diverse datasets. The proposed model significantly decreased the false positive rate while remarkably increasing the prediction rate and accuracy by considering a wide range of assessment indicators. Thus, this study highlights the importance of moving towards anomaly detection methods rather than relying only on signature-based approaches for improved intrusion detection.
Although our proposed model achieved high accuracy on the RT-IoT2022 dataset, practical deployment would require periodic retraining with updated data to accommodate emerging attack patterns. Future research should involve evaluating the model’s performance with new and varied datasets or in live network environments.
From a practical security perspective, even a small false-negative rate (0.3%) could represent a notable risk in scenarios with high network traffic volumes. Nevertheless, our model’s very high precision (~99%) is particularly encouraging, as it suggests a very low false-positive rate. This is beneficial for deployment as it minimises unnecessary alerts and operational disruptions.
Finally, to assess the performance of our proposed model, we compared it with the ML and DL techniques discussed in the most recent intrusion detection literature. The proposed model precisely identified unusual activities and outperformed the other approaches in the hold-out tests, as shown in
Table 9.
While our approach achieved high performance, no oversampling or class-weighting techniques were employed to address dataset imbalance in this study. Therefore, future work will involve applying oversampling methods, such as SMOTE, to further validate and enhance the robustness of the model.
In practical operational scenarios, our proposed intrusion detection model could be deployed centrally to analyse network-wide data or directly on edge IoT devices. Given the substantial dimensionality reduction achieved through feature selection and PCA (from 83 to as few as 5 features), the model becomes computationally lightweight, making it highly suitable for resource-constrained edge environments, thus enabling effective real-time threat detection with reduced computational and bandwidth requirements.
6. Conclusions
In this study, we aimed to find the best data dimensionality reduction technique for predicting unusual network activity patterns. Using a complete set of attributes is impractical when system assets need to be considered. We proposed the use of feature selection methods with PCA to enhance DL algorithms’ prediction of unusual network activity patterns. From the 83 given input variables, we selected five variables and achieved promising intrusion prediction results. Among the prediction models, Pearson–PCA with ANN performed best, with 99.7% accuracy. Pearson analysis derived features correlated with the attack type in network traffic, such as fwd_init_window_size, id.resp_p, service and flow_SYN_flag_count.
Our approach can be employed in many real-life applications related to anomaly-based IDSs to analyse huge datasets and recognise the risk factors involved. This is particularly relevant for AIoT systems, where computational efficiency and high detection accuracy are critical for securing resource-constrained environments. Although the proposed model achieved superior results, it requires improvement. Specifically, the dataset used in this study is imbalanced as it has an unequal distribution of classes, leading to a possible bias in the trained model. In future work, oversampling methods need to be deployed to decrease overfitting and training time and to enhance the accuracy of the proposed model. This involves dividing the dataset into training and testing sets and establishing balanced representations of several attacks and normal activities. Furthermore, evaluating the proposed model in real-time AIoT environments, such as edge devices or smart cities, could provide deeper insights into its scalability and practicality.
In addition, the impact of this study’s findings would be further strengthened by validating them through experimental studies with other datasets related to intrusion detection. Finally, more complex models could be developed to improve the prediction of network attacks, including lightweight, explainable AI techniques tailored to AIoT devices.