An Enhanced XGBoost-Based Framework for Efficient Multi-Class Cyber Threat Detection in Industrial IoT Networks
Abstract
1. Introduction
1.1. Cyber Attacks in IIoT Environments
- System Downtime: attacks on industrial control systems (ICSs) can lead to cascading failures that reduce overall productivity and availability.
- Data Integrity and Confidentiality Breaches: Unauthorized access or manipulation of sensory and operational data can compromise decision-making processes.
- Economic and Physical Risk: The financial burden of recovery is often compounded by physical safety risks, particularly in high-stakes fields like healthcare or autonomous manufacturing.
- Lateral Movement and Propagation: Attackers can exploit compromised nodes to propagate across the network, which will affect additional devices and system components.
1.2. Problem Statement and IIoT Challenges
1.3. Research Contribution
- A hierarchical multi-stage intrusion detection framework is proposed for IIoT environments, which systematically decomposes the detection task into binary, group-level, and fine-grained classification stages. This design improves scalability and reduces inter-class confusion for closely related attack categories.
- A confidence-aware decision mechanism is introduced by integrating probability calibration with class-specific decision thresholds. This mechanism enhances prediction reliability and improves detection performance under class imbalance and overlapping feature distributions.
- An efficient optimization pipeline tailored to IIoT data is developed, which combines data preprocessing, class imbalance handling, hyperparameter tuning, and macro F1 score-driven optimization. While optimization is performed offline, the resulting model supports low-latency inference that makes it suitable for time-sensitive IIoT environments.
- A comprehensive experimental evaluation is conducted on the Edge-IIoTset benchmark dataset including ablation analysis and comparison with machine learning and hybrid deep learning baselines (e.g., CNN, LSTM, and CNN–GRU). The proposed framework achieved significant improvements with up to 21% increase in recall and 15% improvement in macro F1 score, particularly for minority and complex attack classes.
2. Related Works on Detection of Cyber Threats on IIoT
- Most studies adopt single-stage classification frameworks, which limit their ability to capture hierarchical relationships between attack categories.
- Lack of probability calibration and confidence-aware decision-making, which are essential for real-world deployment.
- High computational complexity of deep learning and hybrid models, which is making them less suitable for resource-constrained IIoT environments.
3. System Design of Cyber Threat Detection Algorithm
3.1. Dataset Selection and Preprocessing
3.1.1. Partitioning Method
3.1.2. Handling Imbalance and Feature Scaling
3.2. Automated Hyperparameter Optimization
3.3. Training of the Enhanced XGBoost Ensemble
3.4. Probability Calibration and Threshold Optimization
3.5. Model Evaluation
3.6. Statistical Validation and Reliability Analysis
3.7. Framework Operation and Workflow
- Phase 1: Data Acquisition and Preprocessing.The raw IIoT traffic records are collected and converted into structured feature vectors. Also, the non-numeric attributes are removed, and the categorical labels are encoded. The missing values are handled while feature scaling is applied to ensure numerical stability.
- Phase 2: Dataset Partitioning.The dataset is partitioned into training, validation, and test sets to preserve class distributions and support unbiased performance evaluation.
- Phase 3: Training Dataset.To mitigate class imbalance, oversampling is applied exclusively to the training set, which enables equitable learning across minority attack categories.
- Phase 4: Model Optimization.Bayesian hyperparameter optimization is performed using the validation set to identify the optimal XGBoost configuration. The optimized ensemble is then trained on the imbalanced dataset.
- Phase 5: Probability Calibration and Threshold Selection.The trained model’s probability outputs are calibrated to improve confidence and reliability. Class-specific decision thresholds are optimized to maximize detection effectiveness under asymmetric misclassification costs.
- Phase 6: Threat Scoring and Inference.For each unseen traffic instance, the system computes calibrated class probabilities and assigns a final threat score, which supports alert prioritization and intrusion response. Class-specific decision thresholds are first applied to identify high-confidence candidate classes. If one or more classes satisfy their respective thresholds, the final prediction is assigned to the class with the highest probability among these candidates. Otherwise, a fallback mechanism selects the class with the maximum predicted probability (argmax).
- Phase 7: Statistical Validation and Interpretability (Offline Analysis).Statistical tests and explainability analyses are conducted to validate performance stability and identify influential traffic features.
| Algorithm 1. Pseudo Code of Enhanced XGBoost-Based Threat Scoring Framework | |
| Enhanced XGBoost Framework at IIoT Security Analyzer (Training Phase) | |
Oversampling method; calibration using Isotonic Regression; | |
Calibrated probability function; Class-specific decision thresholds; | |
| Start Algorithm (XGBoost-Train) | |
| 1 | | If model training is initiated then: |
| 2 | | |
| 3 | | |
| 4 | | Encode categorical attributes into numeric form; |
| 5 | | Handle missing values using statistical imputation; |
| 6 | | |
| 7 | | |
| 8 | | to balance class distribution; |
| 9 | | |
| 10 | | do //Hyperparameter optimization |
| 11 | | |
| 12 | | using macro-F1 score; |
| 13 | | End; // Hyperparameter optimization loop |
| 14 | | |
| 15 | | |
| 16 | | do: //Threshold optimization |
| 17 | | maximizing F1 score; |
| 18 | | End; // Threshold optimization loop |
| 19 | | End; // Training Phase |
| 20 | End; // Algorithm |
| Enhanced XGBoost Framework at IIoT Security Analyzer (Inference Phase) | |
Unseen traffic instance xi; | |
| 21 | Start Algorithm (XGBoost-Inference) |
| 22 | | While (new traffic instance received) do: |
| 23 | | |
| 24 | | |
| 25 | |); |
| 26 | | |
| 27 | | do: //Class evaluation |
| 28 | | are used for high-confidence alerting, while argmax determines final class |
| 29 | | Add class c to candidate set C; |
| 30 | | End If; |
| 31 | | End For; // Class evaluation loop |
| 32 | | If C is not empty then |
| 33 | |); //Select highest probability among candidates |
| 34 | | Else |
| 35 | |); // Fallback to global maximum probability |
| 36 | | End If; |
| 37 | |); |
| 38 | | |
| 39 | | End; // While loop |
| 40 | End; // Algorithm |
4. Implementation and Performance Evaluation
4.1. Dataset and Preprocessing: Edge-IIoTset
4.2. Evaluation Metrics
4.3. Baseline Models and Comparison Protocol
- Support Vector Machine (SVM): A classical supervised learning algorithm that is widely used in network intrusion detection due to its effectiveness in high-dimensional spaces and its strong generalization capability.
- Baseline XGBoost: An optimized gradient boosting framework that utilizes second-order optimization and regularization techniques.
- LightGBM: A tree-based ensemble learning method that employs gradient boosting with histogram-based optimization.
- Multi-Layer Perceptron (MLP): A feedforward neural network consisting of fully connected layers. It is capable of learning nonlinear feature representations but lacks the ability to capture temporal dependencies.
- Deep Neural Network (DNN): An extension of MLP with increased depth and complexity, enabling more expressive feature learning. However, it may suffer from overfitting and requires careful tuning.
- Convolutional Neural Network (CNN): A convolutional model adapted for structured input representations, serving as a lightweight deep model.
- Long Short-Term Memory (LSTM): A recurrent neural network designed to capture temporal dependencies in sequential data. It is particularly effective for modeling time-dependent attack patterns in network traffic.
- Hybrid AE + CNN + LSTM: An autoencoder combined with convolutional and recurrent LSTM layers, which represents a recent trend in deep learning for security analytics and temporal dependencies.
- Hybrid CNN–GRU: A hybrid deep learning architecture that integrates convolutional layers for feature extraction with gated recurrent units (GRUs) to capture sequential dependencies. This model is designed to efficiently learn both the spatial and temporal characteristics of network traffic while maintaining lower computational complexity compared to an LSTM-based architecture.
4.4. Performance Evaluation and Comparison
4.4.1. Binary Attack Detection
- Results and Discussion
4.4.2. Group Classification
- Results and Discussion
4.4.3. Multiclass Classification
- Results and Discussion
4.4.4. Ablation Study
4.4.5. Computational Complexity and Efficiency Analysis
5. Limitations and Future Work
5.1. Limitations
5.2. Future Work
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Guo, G.; Qamar, F.; Kazmi, S.H.A.; ur Rehman, M.H. Threat detection in the 6G enabled Industrial IoT Networks using Deep Learning: A review on the state-of-the-art solutions, challenges and future research directions. Internet Things 2025, 33, 101686. [Google Scholar] [CrossRef]
- Ferrag, M.A.; Maglaras, L.; Moschoyiannis, S.; Janicke, H. Deep learning for cyber security intrusion detection: Approaches, datasets, and comparative study. J. Inf. Secur. Appl. 2020, 50, 102419. [Google Scholar] [CrossRef]
- Alshamrani, A.; Myneni, S.; Chowdhary, A.; Huang, D. A survey on advanced persistent threats: Techniques, solutions, challenges, and research opportunities. IEEE Commun. Surv. Tutor. 2019, 21, 1851–1877. [Google Scholar] [CrossRef]
- Yan, P.; Khoei, T.T. Securing the internet of things: A comprehensive review of ransomware attacks, detection, countermeasures, and future prospects. Frankl. Open 2025, 11, 100256. [Google Scholar] [CrossRef]
- Sasi, T.; Lashkari, A.H.; Lu, R.; Xiong, P.; Iqbal, S. A comprehensive survey on IoT attacks: Taxonomy, detection mechanisms and challenges. J. Inf. Intell. 2024, 2, 455–513. [Google Scholar] [CrossRef]
- Dasari, A.K.; Bisawas, S.K.; Purkayastha, B. Enhanced Network Intrusion Detection Systems with Explainable Artificial Intelligence for Network Security. Int. J. Commun. Syst. 2025, 38, e70209. [Google Scholar] [CrossRef]
- Xu, X.; Wang, X. An adaptive Network Intrusion Detection Method Based on PCA and Support Vector Machines. In Proceedings of the International Conference on Advanced Data Mining and Applications, Berlin/Heidelberg, Germany, 22–24 July 2025; Springer: Berlin/Heidelberg, Germany, 2005; pp. 696–703. [Google Scholar]
- Li, J.; Othman, M.S.; Chen, H.; Yusuf, L.M. Optimizing IoT intrusion detection system: Feature selection versus feature extraction in machine learning. J. Big Data 2024, 11, 36. [Google Scholar] [CrossRef]
- Houkan, A.; Sahoo, A.K.; Gochhayat, S.P.; Sahoo, P.K.; Liu, H.; Khalid, S.G.; Jain, P. Enhancing security in industrial IoT networks: Machine learning solutions for feature selection and reduction. IEEE Access 2024, 12, 160864–160883. [Google Scholar] [CrossRef]
- Arreche, O.; Guntur, T.R.; Roberts, J.W.; Abdallah, M. E-xai: Evaluating black-box explainable ai frameworks for network intrusion detection. IEEE Access 2024, 12, 23954–23988. [Google Scholar] [CrossRef]
- Orman, A. Cyberattack detection systems in industrial internet of things (IIoT) networks in big data environments. Appl. Sci. 2025, 15, 3121. [Google Scholar] [CrossRef]
- Susilo, B.; Muis, A.; Sari, R.F. Intelligent Intrusion Detection System Against Various Attacks Based on a Hybrid Deep Learning Algorithm. Sensors 2025, 25, 580. [Google Scholar] [CrossRef]
- Aldhaheri, A.; Alwahedi, F.; Ferrag, M.A.; Battah, A. Deep learning for cyber threat detection in IoT networks: A review. Internet Things Cyber-Phys. Syst. 2024, 4, 110–128. [Google Scholar]
- Gueriani, A.; Kheddar, H.; Mazari, A.C. Adaptive cyber-attack detection in iiot using attention-based lstm-cnn models. In 2024 International Conference on Telecommunications and Intelligent Systems (ICTIS); IEEE: Djelfa, Algeria, 2024; pp. 1–6. [Google Scholar]
- Rehman, Z.; Gondal, I.; Ge, M.; Dong, H.; Gregory, M.; Tari, Z. Proactive defense mechanism: Enhancing IoT security through diversity-based moving target defense and cyber deception. Comput. Secur. 2024, 139, 103685. [Google Scholar] [CrossRef]
- Doghramachi, D.F.; Ameen, S.Y. Internet of Things (IoT) Security Enhancement Using XGboost Machine Learning Techniques. Comput. Mater. Contin. 2023, 77, 717–732. [Google Scholar] [CrossRef]
- Alazab, M.; Khurma, R.A.; García-Arenas, M.; Jatana, V.; Baydoun, A.; Damaševičius, R. Enhanced threat intelligence framework for advanced cybersecurity resilience. Egypt. Inform. J. 2024, 27, 100521. [Google Scholar] [CrossRef]
- Hu, Y.; Xiao, K.; Luo, L.; Chen, L. An XGBoost-Based Intrusion Detection Framework with Interpretability Analysis for IoT Networks. Appl. Sci. 2026, 16, 980. [Google Scholar] [CrossRef]
- Alenazi, M.; Mishra, S. Cyberatttack detection and classification in IIoT systems using XGBoost and Gaussian Naïve Bayes: A comparative study. Eng. Technol. Appl. Sci. Res. 2024, 14, 15074–15082. [Google Scholar] [CrossRef]
- Abdullahi, M.; Alhussian, H.; Aziz, N.; Abdulkadir, S.J.; Alwadain, A.; Muazu, A.A.; Bala, A. Comparison and investigation of AI-based approaches for cyberattack detection in cyber-physical systems. IEEE Access 2024, 12, 31988–32004. [Google Scholar] [CrossRef]
- Alashjaee, A.M.; Alqahtani, F. Enhanced intrusion detection system IoT network security model by feed forward neural network and machine learning. Sci. Rep. 2025, 15, 36085. [Google Scholar] [CrossRef]
- Le, T.-T.-H.; Oktian, Y.E.; Kim, H. XGBoost for Imbalanced Multiclass Classification-Based Industrial Internet of Things Intrusion Detection Systems. Sustainability 2022, 14, 8707. [Google Scholar] [CrossRef]
- Binsaeed, K.A.; Hafez, A.M. Enhancing Intrusion Detection Systems with XGBoost Feature Selection and Deep Learning Approaches. Int. J. Adv. Comput. Sci. Appl. (IJACSA) 2023, 14., 1084–1098. [Google Scholar] [CrossRef]
- Altunay, H.C.; Albayrak, Z. A hybrid CNN+ LSTM-based intrusion detection system for industrial IoT networks. Eng. Sci. Technol. Int. J. 2023, 38, 101322. [Google Scholar] [CrossRef]
- Khan, M.A.; Karim, M.R.; Kim, Y. A Scalable and Hybrid Intrusion Detection System Based on the Convolutional-LSTM Network. Symmetry 2019, 11, 583. [Google Scholar] [CrossRef]
- Anuja, R.; Annrose, J. End-to-end deep learning for smart maritime threat detection: An AE–CNN–LSTM-based approach. Sci. Rep. 2025, 15, 36316. [Google Scholar] [CrossRef]
- Talukder, M.A.; Sharmin, S.; Uddin, M.A.; Islam, M.M.; Aryal, S. MLSTL-WSN: Machine learning-based intrusion detection using SMOTETomek in WSNs. Int. J. Inf. Secur. 2024, 23, 2139–2158. [Google Scholar] [CrossRef]
- Sayegh, H.R.; Dong, W.; Al-madani, A.M. Enhanced intrusion detection with LSTM-based model, feature selection, and SMOTE for imbalanced data. Appl. Sci. 2024, 14, 479. [Google Scholar] [CrossRef]
- Alotaibi, Y.; Ilyas, M. Ensemble-learning framework for intrusion detection to enhance internet of things devices security. Sensors 2023, 23, 5568. [Google Scholar] [CrossRef]
- Aldaej, A.; Ullah, I.; Ahanger, T.A.; Atiquzzaman, M. Ensemble technique of intrusion detection for IoT-edge platform. Sci. Rep. 2024, 14, 11703. [Google Scholar] [CrossRef]
- Dina, A.S.; Siddique, A.B.; Manivannan, D. A deep learning approach for intrusion detection in Internet of Things using focal loss function. Internet Things 2023, 22, 100699. [Google Scholar] [CrossRef]
- Gupta, N.; Jindal, V.; Bedi, P. CSE-IDS: Using cost-sensitive deep learning and ensemble algorithms to handle class imbalance in network-based intrusion detection systems. Comput. Secur. 2022, 112, 102499. [Google Scholar] [CrossRef]
- Khanam, S.; Ahmedy, I.; Idris, M.Y.I.; Jaward, M.H. Towards an effective intrusion detection model using focal loss variational autoencoder for internet of things (IoT). Sensors 2022, 22, 5822. [Google Scholar] [CrossRef]
- Hasan, T.; Tasnim, S. Multidimensional feature learning enhancement in iot intrusion detection: An adaptive cost-sensitive autoencoder and weighted ensemble approach. In 2024 IEEE 10th World Forum on Internet of Things (WF-IoT); IEEE: New York, NY, USA, 2024; pp. 536–541. [Google Scholar]
- Ferrag, M.A.; Friha, O.; Hamouda, D.; Maglaras, L.; Janicke, H. Edge-IIoTset: A New Comprehensive Realistic Cyber Security Dataset of IoT and IIoT Applications for Centralized and Federated Learning, IEEE DataPort, 2022. Available online: https://ieee-dataport.org/documents/edge-iiotset-new-comprehensive-realistic-cyber-security-dataset-iot-and-iiot-applications (accessed on 27 April 2026).
- Ferrag, M.A.; Friha, O.; Hamouda, D.; Maglaras, L.; Janicke, H. Edge-IIoTset: A new comprehensive realistic cyber security dataset of IoT and IIoT applications for centralized and federated learning. IEEE Access 2022, 10, 40281–40306. [Google Scholar] [CrossRef]
- Kumar, D.; Pawar, P.P.; Addula, S.R.; Meesala, M.K.; Oni, O.; Cheema, Q.N.; Haq, A.U.; Sajja, G.S. AI-Powered security for IoT ecosystems: A hybrid deep learning approach to anomaly detection. J. Cybersecur. Priv. 2025, 5, 90. [Google Scholar] [CrossRef]








| Class Name | Total | Training (60%) | Validation (20%) | Testing (20%) |
|---|---|---|---|---|
| Normal | 1,615,643 | 969,385 | 323,129 | 323,129 |
| DDoS_UDP | 121,568 | 72,941 | 24,313 | 24,314 |
| DDoS_ICMP | 116,436 | 69,862 | 23,287 | 23,287 |
| Ransomware | 10,925 | 6555 | 2185 | 2185 |
| DDoS_HTTP | 49,911 | 29,947 | 9982 | 9982 |
| SQL_injection | 51,203 | 30,722 | 10,240 | 10,241 |
| Uploading | 37,634 | 22,580 | 7527 | 7527 |
| DDoS_TCP | 50,062 | 30,037 | 10,013 | 10,012 |
| Backdoor | 24,862 | 14,917 | 4973 | 4972 |
| Vulnerability_scanner | 50,110 | 30,066 | 10,022 | 10,022 |
| Port_Scanning | 22,564 | 13,538 | 4513 | 4513 |
| XSS | 15,915 | 9549 | 3183 | 3183 |
| Password | 50,153 | 30,092 | 10,030 | 10,031 |
| MITM | 1214 | 728 | 243 | 243 |
| Fingerprinting | 1001 | 601 | 200 | 200 |
| Total | 2,219,201 | 1,331,520 | 443,840 | 443,841 |
| Parameters | Configuration |
|---|---|
| Number of Classes | 15 |
| Training/Validation/Test Split | 60% training, 20% validation, 20% testing |
| Feature Scaling | StandardScaler applied to numeric features |
| Class Imbalance Handling | RandomOverSampler (training set only) |
| Hyperparameter Optimization | Optuna Bayesian optimization (80 trials) |
| Tuned Hyperparameters | learning_rate = 0.025, max_depth = 9, gamma = 0.52, subsample = 0.89, colsample_bytree = 0.8, reg_alpha = 0.194, reg_lambda = 2.25, n_estimators = 387) |
| Evaluation Metric (Tuning) | Macro-averaged F1 score on validation |
| Threshold Optimization | Per-class thresholds selected over grid [0.05, 0.95] to maximize macro F1 |
| Probability Calibration | CalibratedClassifierCV with Isotonic and Sigmoid methods |
| Final Test Evaluation Metrics | Precision, Recall, F1 score, Accuracy |
| Bootstrap Confidence Intervals | 95% CI estimated with 500 resamples |
| Metric | Configuration |
|---|---|
| Accuracy (AC) | (TP + TN)/(TP + TN + FP + FN) |
| Precision (PR) | TP/(TP + FP) |
| Recall (RE) | TN/(TN + FN) |
| F1 Score (F1) | 2 × TP/(2 × TP + FP + FN) |
| Dataset | Accuracy | Macro F1 | Attack Recall | Attack Precision |
|---|---|---|---|---|
| Train | 0.9955 | 0.9918 | 0.98 | 1.00 |
| Validation | 0.9948 | 0.9904 | 0.98 | 1.00 |
| Test | 0.9950 | 0.9907 | 0.98 | 1.00 |
| Dataset | Accuracy | Macro F1 | Attack Recall | Attack Precision |
|---|---|---|---|---|
| Train | 0.9866 | 0.9463 | 0.93 | 0.97 |
| Validation | 0.9800 | 0.9150 | 0.90 | 0.94 |
| Test | 0.9799 | 0.9148 | 0.90 | 0.94 |
| Dataset | Accuracy | Macro F1 | Attack Recall | Attack Precision |
|---|---|---|---|---|
| Train | 0.9869 | 0.92 | 0.90 | 0.96 |
| Validation | 0.9821 | 0.91 | 0.89 | 0.93 |
| Test | 0.9815 | 0.91 | 0.88 | 0.93 |
| Model | Accuracy | Macro F1 | Attack Recall | Attack Precision |
|---|---|---|---|---|
| Baseline XGBoost | 0.86 | 0.67 | 0.63 | 0.72 |
| Class Weighted | 0.92 | 0.75 | 0.74 | 0.80 |
| Threshold Optimization | 0.90 | 0.76 | 0.74 | 0.80 |
| Sigmoid Calibration | 0.95 | 0.88 | 0.85 | 0.89 |
| Isotonic Calibration | 0.96 | 0.89 | 0.86 | 0.90 |
| Final Enhanced Model | 0.9815 | 0.91 | 0.88 | 0.93 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Ahmed, A.A.; Abdullah, T.A.A. An Enhanced XGBoost-Based Framework for Efficient Multi-Class Cyber Threat Detection in Industrial IoT Networks. Technologies 2026, 14, 274. https://doi.org/10.3390/technologies14050274
Ahmed AA, Abdullah TAA. An Enhanced XGBoost-Based Framework for Efficient Multi-Class Cyber Threat Detection in Industrial IoT Networks. Technologies. 2026; 14(5):274. https://doi.org/10.3390/technologies14050274
Chicago/Turabian StyleAhmed, Adel A., and Talal A. A. Abdullah. 2026. "An Enhanced XGBoost-Based Framework for Efficient Multi-Class Cyber Threat Detection in Industrial IoT Networks" Technologies 14, no. 5: 274. https://doi.org/10.3390/technologies14050274
APA StyleAhmed, A. A., & Abdullah, T. A. A. (2026). An Enhanced XGBoost-Based Framework for Efficient Multi-Class Cyber Threat Detection in Industrial IoT Networks. Technologies, 14(5), 274. https://doi.org/10.3390/technologies14050274

