## 3 Materials and Methods
### Performance Assessment and Explainability in Intrusion Detection Models  
Model effectiveness is primarily assessed using accuracy as the main evaluation metric. In addition, confusion matrices are used to visualize and interpret the distribution of predictions across classes, providing detailed insights into the model's ability to differentiate between legitimate and malicious traffic. To improve transparency in decision-making, particularly within the domain of intrusion detection, post hoc explainability methods, namely \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline
**Category** & **Aspect** & **LIME** & **SHAP** \\ \hline \multirow{4}{*}{Theoretical Foundation} & Definition & Local surrogate models fitted to perturbed data. & Shapley values from cooperative game theory. \\  & Mathematical Guarantees & No formal guarantees; relies on local fidelity. & Satisfies properties like consistency, completeness, and efficiency. \\ \hline \multirow{4}{*}{Scope and Focus} & Explanation Level & Local (instance-level). & Local and global (individual and model-wide). \\  & Interaction Awareness & Limited; interactions are not captured. & Captures feature interactions and additive effects. \\ \hline \multirow{4}{*}{Practical Implications} & Interpretability & Flexible; user-defined interpretable models. & Rigid but principled feature attributions. \\  & Use Case Suitability & Exploratory analysis, quick diagnostics. & Audits, compliance, high-stakes decisions. \\  & Limitations & Sensitive to perturbation technique; may yield inconsistent explanations. & Computationally expensive; may not scale easily to deep models. \\ \hline \end{tabular}
\end{table} 
Table 7: Functional, methodological, and practical comparison of LIME and SHAP. Figure 2: Visual comparison of LIME and SHAP, highlighting key interpretability characteristics. SHAP and LIME, are applied to identify the most influential features that contribute to the decision-making of the model. To mitigate the risk of overfitting, the machine learning models implemented in this study incorporate architectural strategies designed to improve generalization. In the case of XGBoost, this includes validation-based early stopping and L1/L2 regularization techniques, that is, the inclusion of penalty terms based on the absolute (L1) and squared (L2) magnitudes of model parameters, which effectively limit model complexity and prevent over-reliance on specific features. Conversely, TabNet employs a sparse, attentive mechanism that selectively emphasizes the most relevant features, inherently promoting generalization while preserving interpretability. The combination of these strategies, adaptive learning dynamics and built-in regularization, ensures stable and efficient training, reducing the need for additional overfitting-control procedures. To evaluate the suitability of explainable artificial intelligence (XAI) techniques in forensic applications, it is essential to adopt metrics that go beyond general interpretability and address legal, procedural, and reliability concerns. Three core metrics are commonly adopted in the literature: the fidelity score, stability analysis, and Jaccard similarity. Fidelity has been widely discussed as a means of assessing how faithfully an explanation reflects the underlying model's behavior, especially in local contexts [38]. High fidelity is critical for expert validation and for defending model decisions in legally sensitive environments [33]. Stability, often evaluated by introducing controlled perturbations to the input, reflects the robustness and reproducibility of XAI methods. Stable explanations are increasingly considered essential for admissibility of AI-generated evidence in digital forensics [39, 40]. Jaccard similarity has gained traction in comparative studies of XAI methods, quantifying overlap in the top explanatory features across methods or instances [41].