Linking Class-Wise SHAP Attribution Drift To Detection Degradation Under Cross-Dataset Shift In Network Intrusion Detection

  • Unique Paper ID: 211653
  • PageNo: 63-68
  • Abstract:
  • Machine-learning-based network intrusion detection systems (NIDS) can achieve high classification performance on benchmark datasets but may fail to generalize to different network environments. Explainable artificial intelligence techniques such as SHapley Additive exPlanations (SHAP) provide insight into model feature importance, but the stability of these explanations does not necessarily indicate successful detection transfer. This study experimentally investigates the relationship between class-wise SHAP attribution drift and detection degradation under cross-dataset distribution shift. Random Forest and XGBoost classifiers were trained and evaluated bidirectionally using selected captures from CIC-IDS2017 and CSE-CIC-IDS2018. Seven harmonized traffic classes and 23 common features were retained, with 5,000 samples per class in each prepared dataset. Class-wise SHAP attribution rankings were compared using Spearman correlation and Top-10 Jaccard similarity. Detection degradation was measured through changes in class-wise recall, while exact permutation tests and Holm correction were used to examine associations between attribution drift and recall degradation. Cross-dataset Macro F1 declined to 0.2500–0.2780, compared with source-holdout scores of 0.8864–0.9695. Despite this decline, mean class-wise Spearman correlations ranged from 0.8226 to 0.9366 for Random Forest and from 0.8602 to 0.9286 for XGBoost, indicating relatively stable feature-attribution rankings despite substantial cross-dataset detection performance degradation. Several classes exhibited high attribution-ranking similarity despite near-zero target recall. The association between attribution drift and recall degradation varied across models and transfer directions, with no association remaining statistically significant after multiple-testing correction. These findings demonstrate that global SHAP attribution-ranking stability and cross-dataset detection performance should be evaluated as distinct properties of intrusion detection models.

Copyright & License

Copyright © 2026 Authors retain the copyright of this article. This article is an open access article distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

BibTeX

@article{211653,
        author = {Aditya Rameshwar Karmase and Prof. Smt. K.N. Gadakh},
        title = {Linking Class-Wise SHAP Attribution Drift To Detection Degradation Under Cross-Dataset Shift In Network Intrusion Detection},
        journal = {International Journal of Innovative Research in Technology},
        year = {2026},
        volume = {13},
        number = {no},
        pages = {63-68},
        issn = {2349-6002},
        url = {https://ijirt.org/article?manuscript=211653},
        abstract = {Machine-learning-based network intrusion detection systems (NIDS) can achieve high classification performance on benchmark datasets but may fail to generalize to different network environments. Explainable artificial intelligence techniques such as SHapley Additive exPlanations (SHAP) provide insight into model feature importance, but the stability of these explanations does not necessarily indicate successful detection transfer. This study experimentally investigates the relationship between class-wise SHAP attribution drift and detection degradation under cross-dataset distribution shift. Random Forest and XGBoost classifiers were trained and evaluated bidirectionally using selected captures from CIC-IDS2017 and CSE-CIC-IDS2018. Seven harmonized traffic classes and 23 common features were retained, with 5,000 samples per class in each prepared dataset. Class-wise SHAP attribution rankings were compared using Spearman correlation and Top-10 Jaccard similarity. Detection degradation was measured through changes in class-wise recall, while exact permutation tests and Holm correction were used to examine associations between attribution drift and recall degradation. Cross-dataset Macro F1 declined to 0.2500–0.2780, compared with source-holdout scores of 0.8864–0.9695. Despite this decline, mean class-wise Spearman correlations ranged from 0.8226 to 0.9366 for Random Forest and from 0.8602 to 0.9286 for XGBoost, indicating relatively stable feature-attribution rankings despite substantial cross-dataset detection performance degradation. Several classes exhibited high attribution-ranking similarity despite near-zero target recall. The association between attribution drift and recall degradation varied across models and transfer directions, with no association remaining statistically significant after multiple-testing correction. These findings demonstrate that global SHAP attribution-ranking stability and cross-dataset detection performance should be evaluated as distinct properties of intrusion detection models.},
        keywords = {Network Intrusion Detection, Explainable Artificial Intelligence, SHAP, Cross-Dataset Generalization, Distribution Shift, Random Forest, XGBoost.},
        month = {November},
        }

Cite This Article

Karmase, A. R., & Gadakh, P. S. K. (2026). Linking Class-Wise SHAP Attribution Drift To Detection Degradation Under Cross-Dataset Shift In Network Intrusion Detection. International Journal of Innovative Research in Technology (IJIRT), 63–68.

Related Articles