Utilizing XAI Technique to Improve Autoencoder based Model for Computer Network Anomaly Detection with Shapley Additive Explanation(SHAP)

Khushnaseeb Roshan, Aasim ZafarInternational Journal of Computer Networks & Communications 2021 · DOI

TL;DR

This paper tackles the "black box" problem in deep learning-based network anomaly detection by using Explainable AI (XAI) techniques, specifically SHAP (Shapley Additive Explanation). By identifying the features most responsible for anomalous behavior, they developed a more accurate and interpretable anomaly detection model, achieving 94% accuracy and 0.969 AUC.

What Problem Does This Paper Address?

The increasing reliance on Machine Learning (ML) and Deep Learning (DL) for network security tasks like anomaly detection is hampered by their inherent lack of transparency. These "black box" models, while powerful, make it difficult to understand why a particular decision is made, hindering trust and further improvement. This opacity is particularly problematic in network anomaly detection, where understanding the root cause of an anomaly is crucial for effective response. This paper aims to bridge this gap by using XAI to not only explain the predictions of an autoencoder-based anomaly detection model but also to leverage that understanding to enhance its performance.

Methods

The core of this research lies in the application of Explainable AI (XAI) to an autoencoder model for network anomaly detection.

  • Autoencoder for Anomaly Detection: Autoencoders are a type of unsupervised neural network trained on normal (benign) network traffic. They learn to reconstruct this normal data with low error. When presented with anomalous (attack) data, the reconstruction error is significantly higher, signaling an anomaly.
  • SHAP (Shapley Additive Explanation): This is the key XAI technique employed. SHAP is a model-agnostic approach that uses Shapley values from game theory to attribute the contribution of each feature to the model's prediction. In this context, it's used to determine which features are most responsible for the high reconstruction error in anomalous instances.
  • Kernel SHAP: Specifically, the kernel SHAP method is used. This approach is flexible and can be applied to any ML/DL model. It requires a "value function" that quantifies the reconstruction error. The authors define this value function based on the Mean Squared Error (MSE) of the autoencoder.
  • Novel Feature Selection: The paper proposes a novel feature selection method based on SHAP values. Instead of using all features or features selected through traditional correlation methods, they identify the top 30 features that have the largest SHAP values, indicating they are the primary drivers of anomalous reconstruction errors.
  • Model Improvement: These top 30 features are then used to train a new, improved autoencoder model, termed the "SHAP_Model." This model is trained solely on benign data.

Datasets

  • CICIDS2017 Dataset: A subset of this dataset was used for training and evaluation. The authors chose CICIDS2017 over older datasets like KDDCUP99 and NSLKDD because it is more recent, contains a wider variety of attacks, and better represents real-time network traffic.
  • Training Data: The Monday portion of the dataset, containing only benign traffic, was used for training and validation.
  • Testing Data: The Friday portion of the dataset, containing both benign and attack samples (specifically DDoS attacks), was used for testing.

Key Insights and Ideas

  • XAI as a Performance Enhancer: The most significant insight is that XAI isn't just for understanding; it can actively improve model performance. By pinpointing the causes of anomalies (features with high SHAP values), the researchers could create a more focused and effective anomaly detection model.
  • Feature Importance Beyond Raw Error: The paper highlights that a high reconstruction error on a single feature doesn't necessarily mean that feature is the sole cause of the anomaly. SHAP values provide a more nuanced understanding by attributing the true contribution of each feature to the overall error, considering interactions between features.
  • Focusing on Anomalous Drivers: The strategy of selecting features that cause high reconstruction errors (rather than just high reconstruction errors themselves) is a key differentiator. This targeted approach leads to a more robust model.
  • Interpretability Enables Trust: By providing explanations for anomalies, the SHAP_Model fosters greater trust in the system, which is crucial for real-world deployment in critical security applications.

Key Results

The proposed SHAP_Model demonstrated superior performance compared to two baseline models:

  • Model_1: Trained on all 78 features.
  • Model_2: Trained on 39 features selected using an unsupervised correlation method.
  • SHAP_Model: Trained on the top 30 features identified by SHAP values.

The key quantitative results for the SHAP_Model are:

  • Accuracy: 94%
  • AUC (Area Under the ROC Curve): 0.969
  • Precision: 0.83
  • Recall: 0.99
  • F-score: 0.90

The SHAP_Model significantly outperformed both Model_1 and Model_2 across these metrics, particularly in AUC and G-mean (a metric for imbalanced datasets). The paper also shows that only a small fraction (0.32%) of anomalies were misclassified by the SHAP_Model.

Limitations and Future Work

  • Computational Cost of Kernel SHAP: The authors acknowledge that the kernel SHAP method can be computationally expensive, especially for high-dimensional datasets or when a large background set is used for explanation. This increases the time complexity of building the explanation model.
  • Background Set Selection: Choosing an appropriate background set for the kernel SHAP method is crucial and can impact the results.
  • Future Work:
    • Testing the proposed method on other benchmark and newer datasets for network anomaly detection.
  • Extending the approach to other unsupervised DL architectures like Deep Belief Networks (DBN) and Restricted Boltzmann Machines (RBM).
  • Further research into optimizing the SHAP approach for efficiency.

Summary updated

Abstract

Machine learning (ML) and Deep Learning (DL) methods are being adopted rapidly, especially in computer network security, such as fraud detection, network anomaly detection, intrusion detection, and much more. However, the lack of transparency of ML and DL based models is a major obstacle to their implementation and criticized due to its black-box nature, even with such tremendous results. Explainable Artificial Intelligence (XAI) is a promising area that can improve the trustworthiness of these models by giving explanations and interpreting its output. If the internal working of the ML and DL based models is understandable, then it can further help to improve its performance. The objective of this paper is to show that how XAI can be used to interpret the results of the DL model, the autoencoder in this case. And, based on the interpretation, we improved its performance for computer network anomaly detection. The kernel SHAP method, which is based on the shapley values, is used as a novel feature selection technique. This method is used to identify only those features that are actually causing the anomalous behaviour of the set of attack/anomaly instances. Later, these feature sets are used to train and validate the autoencoderbut on benign data only. Finally, the built SHAP_Model outperformed the other two models proposed based on the feature selection method. This whole experiment is conducted on the subset of the latest CICIDS2017 network dataset. The overall accuracy and AUC of SHAP_Model is 94% and 0.969, respectively.
BibTeX
@article{roshan2021utilizing,
  author = {Khushnaseeb Roshan and Aasim Zafar},
  title = {{Utilizing XAI Technique to Improve Autoencoder based Model for Computer Network Anomaly Detection with Shapley Additive Explanation(SHAP)}},
  journal = {International Journal of Computer Networks \& Communications},
  year = {2021},
  doi = {10.5121/ijcnc.2021.13607},
}
Figure