An Explainable Fuzzy–AI Framework for Cybersecurity ThreatAssessment under Uncertainty
DOI:
https://doi.org/10.65879/3070-5789.2026.02.08Keywords:
Cybersecurity, fuzzy logic, explainable artificial intelligence, intrusion detection, SHAP, threat assessment, probability calibration, CICIDS2017Abstract
Artificial-intelligence-based intrusion detection systems can achieve strong predictive performance, but their probability outputs are often treated as final decisions without an explicit representation of operational context. This study proposes an explainable hybrid Fuzzy–AI framework that separates attack detection from threat assessment. A supervised detector estimates a calibrated probability of malicious activity (AP) from network-flow features, and a Mamdani fuzzy layer combines AP with traffic volume, connection duration, protocol anomaly and source reliability to produce a continuous Cyber Threat Level (CTL, 0–100) and five linguistic priority classes. The revised rule base (49 rules) covers all 243 antecedent combinations, guarantees that a high-confidence detection is never rated below Moderate, and keeps AP influential in every context. Experiments used a reproducible 10% file-wise sample of CICIDS2017 (269,091 flows). Because destination port and initial TCP window sizes act as capture artefacts, the detector was re-evaluated without them, under a stratified random split and two temporal hold-outs, over five seeds. With the leakage-reduced feature set, XGBoost reached F1 = 0.9875 ± 0.0014 on the random split, but F1 = 0.9691 ± 0.0014 on a within-file chronological hold-out and 0.4478 ± 0.0185 when all Friday traffic was held out, showing that near-perfect random-split scores overstate generalisation. Isotonic calibration changed the expected calibration error from 0.0052 ± 0.0005 to 0.0008 ± 0.0002. Run on every test flow with training-only context estimators, the revised fuzzy layer placed 98.60% ± 0.17 of attacks and 1.54% ± 0.14 of benign flows in the High/Critical classes (detector probability alone: 0.11% ± 0.02 of benign flows), whereas the original 35-rule base was undefined for 20.03% ± 0.10 of test flows. When Friday traffic was held out, contextual indicators did not recover the attacks missed by the detector. Controlled analyses showed that two events with the same AP of 0.82 received CTL 81.2 (Critical) and 50.0 (Moderate) under severe and benign context, and variance-based sensitivity analysis attributed the largest share of CTL variance to AP, followed by protocol anomaly and source reliability. SHAP explains the detector and the fired rules explain the threat level, supporting fuzzy contextualisation as a transparent post-detection layer for alert prioritisation rather than as a replacement for the classifier.
References
[1] I. Sharafaldin, A. H. Lashkari, and A. A. Ghorbani, "Toward Generating a New Intrusion Detection Dataset and Intrusion Traffic Characterization," in Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP), 2018, pp. 108–116. doi: 10.5220/0006639801080116.
[2] S. M. Lundberg and S.-I. Lee, "A Unified Approach to Interpreting Model Predictions," in Advances in Neural Information Processing Systems 30, 2017.
[3] G. Rjoub, J. Bentahar, O. Abdel Wahab, R. Mizouni, A. Song, R. S. Cohen, H. Otrok, and A. Mourad, "A Survey on Explainable Artificial Intelligence for Cybersecurity," IEEE Transactions on Network and Service Management, vol. 20, no. 4, pp. 5115–5140, 2023. doi: 10.1109/TNSM.2023.3282740.
[4] F. Charmet, H. C. Tanuwidjaja, S. Ayoubi, P. Gimenez, Y. Han, H. Jmila, G. Blanc, T. Takahashi, and Z. Zhang, "Explainable artificial intelligence for cybersecurity: a literature survey," Annals of Telecommunications, vol. 77, pp. 789–812, 2022. doi: 10.1007/s12243-022-00926-7.
[5] E. Tabassi, Artificial Intelligence Risk Management Framework (AI RMF 1.0), NIST AI 100-1. National Institute of Standards and Technology, 2023. doi: 10.6028/NIST.AI.100-1.
[6] L. A. Zadeh, "Fuzzy Sets," Information and Control, vol. 8, no. 3, pp. 338–353, 1965. doi: 10.1016/S0019-9958(65)90241-X.
[7] E. H. Mamdani, "Application of fuzzy algorithms for control of simple dynamic plant," Proceedings of the Institution of Electrical Engineers, vol. 121, no. 12, pp. 1585–1588, 1974. doi: 10.1049/piee.1974.0328.
[8] L. Breiman, "Random Forests," Machine Learning, vol. 45, pp. 5–32, 2001. doi: 10.1023/A:1010933404324.
[9] T. Chen and C. Guestrin, "XGBoost: A Scalable Tree Boosting System," in Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016, pp. 785–794. doi: 10.1145/2939672.2939785.
[10] D. P. Kingma and J. Ba, "Adam: A Method for Stochastic Optimization," in International Conference on Learning Representations (ICLR), 2015.
[11] F. Pedregosa et al., "Scikit-learn: Machine Learning in Python," Journal of Machine Learning Research, vol. 12, pp. 2825–2830, 2011.
[12] D. W. Apley and J. Zhu, "Visualizing the Effects of Predictor Variables in Black Box Supervised Learning Models," Journal of the Royal Statistical Society: Series B, vol. 82, no. 4, pp. 1059–1086, 2020. doi: 10.1111/rssb.12377.
[13] M. T. Ribeiro, S. Singh, and C. Guestrin, "Why Should I Trust You?: Explaining the Predictions of Any Classifier," in Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016, pp. 1135–1144. doi: 10.1145/2939672.2939778.
[14] C. Molnar, Interpretable Machine Learning: A Guide for Making Black Box Models Explainable, 2nd ed., 2022. Available: https://christophm.github.io/interpretable-ml-book/
[15] K. Alsubhi, I. Aib, and R. Boutaba, "FuzMet: a fuzzy-logic based alert prioritization engine for intrusion detection systems," International Journal of Network Management, vol. 22, no. 4, pp. 263–284, 2012. doi: 10.1002/nem.804.
[16] M. Alali, A. Almogren, M. M. Hassan, I. A. L. Rassan, and M. Z. A. Bhuiyan, "Improving risk assessment model of cyber security using fuzzy logic inference system," Computers & Security, vol. 74, pp. 323–339, 2018. doi: 10.1016/j.cose.2017.09.011.
[17] A. H. Hamamoto, L. F. Carvalho, L. D. H. Sampaio, T. Abrão, and M. L. Proença Jr., "Network anomaly detection system using genetic algorithm and fuzzy logic," Expert Systems with Applications, vol. 92, pp. 390–402, 2018. doi: 10.1016/j.eswa.2017.09.013.
[18] A. N. Toosi and M. Kahani, "A new approach to intrusion detection based on an evolutionary soft computing model using neuro-fuzzy classifiers," Computer Communications, vol. 30, no. 10, pp. 2201–2212, 2007. doi: 10.1016/j.comcom.2007.05.002.
[19] J. Liu, W. Yinchai, T. C. Siong, X. Li, L. Zhao, and F. Wei, "A hybrid interpretable deep structure based on adaptive neuro-fuzzy inference system, decision tree, and K-means for intrusion detection," Scientific Reports, vol. 12, 2022. doi: 10.1038/s41598-022-23765-x.
[20] J.-S. R. Jang, "ANFIS: adaptive-network-based fuzzy inference system," IEEE Transactions on Systems, Man, and Cybernetics, vol. 23, no. 3, pp. 665–685, 1993. doi: 10.1109/21.256541.
[21] G. Engelen, V. Rimmer, and W. Joosen, "Troubleshooting an intrusion detection dataset: the CICIDS2017 case study," in 2021 IEEE Security and Privacy Workshops (SPW), 2021, pp. 7–12. doi: 10.1109/SPW53761.2021.00009.
[22] M. Lanvin, P.-F. Gimenez, Y. Han, F. Majorczyk, L. Mé, and É. Totel, "Errors in the CICIDS2017 dataset and the significant differences in detection performances it makes," in Risks and Security of Internet and Systems (CRiSIS 2022), Lecture Notes in Computer Science, vol. 13857, Springer, 2023, pp. 18–33. doi: 10.1007/978-3-031-31108-6_2.
[23] D. Arp, E. Quiring, F. Pendlebury, A. Warnecke, F. Pierazzi, C. Wressnegger, L. Cavallaro, and K. Rieck, "Dos and don'ts of machine learning in computer security," in Proceedings of the 31st USENIX Security Symposium, 2022, pp. 3971–3988.
[24] F. Pendlebury, F. Pierazzi, R. Jordaney, J. Kinder, and L. Cavallaro, "TESSERACT: eliminating experimental bias in malware classification across space and time," in Proceedings of the 28th USENIX Security Symposium, 2019, pp. 729–746.
[25] S. Neupane, J. Ables, W. Anderson, S. Mittal, S. Rahimi, I. Banicescu, and M. Seale, "Explainable intrusion detection systems (X-IDS): a survey of current methods, challenges, and opportunities," IEEE Access, vol. 10, pp. 112392–112415, 2022. doi: 10.1109/ACCESS.2022.3216617.
[26] M. Wang, K. Zheng, Y. Yang, and X. Wang, "An explainable machine learning framework for intrusion detection systems," IEEE Access, vol. 8, pp. 73127–73141, 2020. doi: 10.1109/ACCESS.2020.2988359.
[27] H. Hagras, "Toward human-understandable, explainable AI," Computer, vol. 51, no. 9, pp. 28–36, 2018. doi: 10.1109/MC.2018.3620965.
[28] M. J. Gacto, R. Alcalá, and F. Herrera, "Interpretability of linguistic fuzzy rule-based systems: an overview of interpretability measures," Information Sciences, vol. 181, no. 20, pp. 4340–4360, 2011. doi: 10.1016/j.ins.2011.02.021.
[29] C. C. Lee, "Fuzzy logic in control systems: fuzzy logic controller, Part I," IEEE Transactions on Systems, Man, and Cybernetics, vol. 20, no. 2, pp. 404–418, 1990. doi: 10.1109/21.52551.
[30] A. Niculescu-Mizil and R. Caruana, "Predicting good probabilities with supervised learning," in Proceedings of the 22nd International Conference on Machine Learning (ICML), 2005, pp. 625–632. doi: 10.1145/1102351.1102430.
[31] B. Zadrozny and C. Elkan, "Transforming classifier scores into accurate multiclass probability estimates," in Proceedings of the 8th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2002, pp. 694–699. doi: 10.1145/775047.775151.
[32] C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger, "On calibration of modern neural networks," in Proceedings of the 34th International Conference on Machine Learning (ICML), PMLR vol. 70, 2017, pp. 1321–1330.
[33] A. Saltelli, P. Annoni, I. Azzini, F. Campolongo, M. Ratto, and S. Tarantola, "Variance based sensitivity analysis of model output. Design and estimator for the total sensitivity index," Computer Physics Communications, vol. 181, no. 2, pp. 259–270, 2010. doi: 10.1016/j.cpc.2009.09.018.
[34] J. Herman and W. Usher, "SALib: an open-source Python library for sensitivity analysis," Journal of Open Source Software, vol. 2, no. 9, p. 97, 2017. doi: 10.21105/joss.00097.
[35] R. Sommer and V. Paxson, "Outside the closed world: on using machine learning for network intrusion detection," in 2010 IEEE Symposium on Security and Privacy, 2010, pp. 305–316. doi: 10.1109/SP.2010.25.
[36] B. Iglewicz and D. C. Hoaglin, How to Detect and Handle Outliers. Milwaukee, WI: ASQC Quality Press, 1993.
Downloads
Additional Files
Published
Issue
Section
License
Copyright (c) 2026 Rahib Imamguluyev (Author)

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.