## 6 XAI-Based Explanations  
Experiments with two XAI methods--LIME and SHAP--were carried out to investigate their ability to explain classification results with more complex models, such as MLP. First, two multilayer perceptron models were created and trained on different datasets. The first model was trained with our joined CIC-IDS2017/-2018 dataset. The second model was trained with the same dataset, only with an addition of \"unrelated_column\" values, which were set randomly. Figure 8: Misclassification results of different types of malicious attacks. (**a**) LR; (**b**) DT CART; (**c**) DT ID3; (**d**) RF; (**e**) MLP; (**f**) Dense-layer net. Both models' explanations were first generated with LIME. For explanations, input values were selected that generated model predictions, indicating a network anomaly. In this case, inputs passed to both models indicated a network anomaly--\"DDoS\" attack. Figure 9 shows which attributes had the greatest impact on the prediction, where the green columns indicate that they have a positive effect, i.e., they increase the model's score, while the red columns decrease the score. From the data, it was observed that not only were the features that had the biggest impact on the model output different, but in \"unrelated_column\", they had the most importance, although its values were completely random. However, in both cases, this instance was classified as a benign attack for the original dataset (see Figure 9) with 83% probability and for the modified dataset (see Figure 9) with 90% probability). Further explanations of both models were developed using the SHAP approach. In this scenario, a sample instance of data had been submitted, the output of which was a \"Benign\" class. The data presented in Figure 10 shows that the results are similar to those of the LIME models, considering that \"unrelated_column\" had the largest impact on the decision. When comparing the LIME and SHAP local explanation cases, almost every time the LIME explanations were generated, a different result was obtained, whereas SHAP was more stable in assessing the influence of attributes. Figure 10: SHAP local explanations. (**a**) Model explanation with original dataset; (**b**) Model explanation with added “unrelated_column” random values. Figure 9: LIME local explanations. (**a**) Explanation with original dataset; (**b**) Explanation with added “unrelated_column”. While performing the aforementioned experiments, certain drawbacks were observed of both LIME and SHAP explanation methods. For instance, LIME implementation is limited to providing explanations for individual instances within the dataset and lacks the ability to generate global explanations like SHAP. This means that in order to obtain a view of dataset-wide scope, the user has to generate explanations of every single instance of the dataset. Due to this issue, the process of analyzing and interpreting results can become complex, especially when working with datasets that contain over 19 million data entries, as is the case in our situation. Even in the case when a user is interested in only one data instance of the dataset, additional interpretability problems arise when a multiclass model is used. In this research, an MLP model was used to generate the LIME explanations, which resulted in separate explanations for all 28 classes, taking into account the influence of 79 features. The most interesting results for the eight classes are shown in Figure 11.  
Meanwhile, SHAP can provide global explanations, and while this enables us to see explanations for the whole dataset, explanations can still be hard to interpret when using multiclass output models. Figure 12, provides global explanations for 28 classes, providing an importance score for the most dominant features. Although this allows for a  
Figure 11: LIME local explanations for all eight separate classes in the dataset: red for positive impacts, blue for negative impacts.