<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.1 20151215//EN" "http://jats.nlm.nih.gov/publishing/1.1/JATS-journalpublishing1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xml:lang="en" article-type="research-article" dtd-version="1.1">
<front>
<journal-meta>
<journal-id journal-id-type="pmc">JCS</journal-id>
<journal-id journal-id-type="nlm-ta">JCS</journal-id>
<journal-id journal-id-type="publisher-id">JCS</journal-id>
<journal-title-group>
<journal-title>Journal of Cyber Security</journal-title>
</journal-title-group>
<issn pub-type="epub">2579-0064</issn>
<issn pub-type="ppub">2579-0072</issn>
<publisher>
<publisher-name>Tech Science Press</publisher-name>
<publisher-loc>USA</publisher-loc>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">79097</article-id>
<article-id pub-id-type="doi">10.32604/jcs.2026.079097</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Article</subject>
</subj-group>
</article-categories>
<title-group>
<article-title>Domain Knowledge-Guided Training for NIDS: A Class-Agnostic Evaluation of Robustness on Imbalanced Datasets</article-title>
<alt-title alt-title-type="left-running-head">Domain Knowledge-Guided Training for NIDS: A Class-Agnostic Evaluation of Robustness on Imbalanced Datasets</alt-title>
<alt-title alt-title-type="right-running-head">Domain Knowledge-Guided Training for NIDS: A Class-Agnostic Evaluation of Robustness on Imbalanced Datasets</alt-title>
</title-group>
<contrib-group>
<contrib id="author-1" contrib-type="author" corresp="yes">
<name name-style="western"><surname>Abdelhalim</surname><given-names>Zakaria S. M.</given-names></name><email>z.abdelha53974@student.aast.edu</email></contrib>
<contrib id="author-2" contrib-type="author">
<name name-style="western"><surname>Belal</surname><given-names>Nahla</given-names></name></contrib>
<contrib id="author-3" contrib-type="author">
<name name-style="western"><surname>Seifeldin</surname><given-names>Mohamed</given-names></name></contrib>
<aff id="aff-1"><institution>College of Computing and Information Technology, Arab Academy for Science, Technology and Maritime Transport</institution>, <addr-line>Smart Village, Giza</addr-line>, <country>Egypt</country></aff>
</contrib-group>
<author-notes>
<corresp id="cor1"><label>&#x002A;</label>Corresponding Author: Zakaria S. M. Abdelhalim. Email: <email>z.abdelha53974@student.aast.edu</email></corresp>
</author-notes>
<pub-date date-type="collection" publication-format="electronic">
<year>2026</year></pub-date>
<pub-date date-type="pub" publication-format="electronic">
<day>06</day>
<month>04</month>
<year>2026</year></pub-date>
<volume>8</volume>
<issue>1</issue>
<fpage>153</fpage>
<lpage>169</lpage>
<history>
<date date-type="received">
<day>14</day>
<month>01</month>
<year>2026</year>
</date>
<date date-type="accepted">
<day>10</day>
<month>03</month>
<year>2026</year>
</date>
</history>
<permissions>
<copyright-statement>&#x00A9; 2026 The Authors. Published by Tech Science Press.</copyright-statement>
<copyright-year>2026</copyright-year>
<copyright-holder>The Authors</copyright-holder>
<license xlink:href="https://creativecommons.org/licenses/by/4.0/">
<license-p>This work is licensed under a <ext-link ext-link-type="uri" xlink:type="simple" xlink:href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</ext-link>, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.</license-p>
</license>
</permissions>
<self-uri content-type="pdf" xlink:href="TSP_JCS_79097.pdf"></self-uri>
<abstract>
<p>The rapid expansion of IoT and cloud services has increased the scale and complexity of modern networks, making intrusion detection challenging. Although deep learning-based Network Intrusion Detection Systems (NIDS) often report high accuracy, such metrics can be misleading on highly imbalanced datasets, where performance is dominated by majority classes and rare attacks remain poorly detected. This issue stems from global optimization strategies that encourage models to rely on dominant feature patterns, limiting their ability to capture the class-specific features required to identify infrequent attack types. To address this limitation, this work proposes a domain knowledge-guided attentional training framework. In the first stage, SHAP is used to extract per-class feature importance vectors, identifying features that are relevant or negligible for each attack type. In the second stage, a knowledge-guided loss function introduces a weighted gradient regularization term that penalizes reliance on features deemed unimportant for the target class, encouraging the model to focus on class-specific features. The proposed approach is evaluated on the highly imbalanced CIC-IDS-2017 dataset. While a baseline CNN achieved an overall accuracy of 99.39%, it failed to detect rare attacks such as Heartbleed (F1 score &#x003D; 0.0). In contrast, the knowledge-guided model demonstrated improved robustness across attack classes. Emphasizing Macro F1 score as a class-agnostic metric, the proposed framework improved the Macro F1 from 0.6180 to 0.7560, achieved an F1 score of 1.0 on Heartbleed, and maintained overall accuracy (99.56%). Overall, this work enables NIDS to move beyond static optimization by focusing on class-specific features, leading to improved generalization for rare attacks.</p>
</abstract>
<kwd-group kwd-group-type="author">
<kwd>IDS</kwd>
<kwd>deep learning</kwd>
<kwd>imbalanced learning</kwd>
<kwd>SHAP</kwd>
<kwd>gradient regularization</kwd>
</kwd-group>
</article-meta>
</front>
<body>
<sec id="s1">
<label>1</label>
<title>Introduction</title>
<p>The rapid expansion of interconnected systems, from the Internet of Things to cloud computing, has led to a substantial increase in network scale and complexity. While this increased connectivity enables a wide range of services, it also expands the attack surface, making robust Network Intrusion Detection Systems (NIDS) a critical component of modern cybersecurity architectures [<xref ref-type="bibr" rid="ref-1">1</xref>,<xref ref-type="bibr" rid="ref-2">2</xref>].</p>
<p>In recent years, Machine Learning and Deep Learning have become the dominant approach for NIDS, with many publications reporting very high accuracy on benchmark datasets. For instance, studies on the CIC-IDS-2017 dataset often report accuracy exceeding 98% across a wide range of machine learning and deep learning approaches, including hybrid and ensemble models [<xref ref-type="bibr" rid="ref-1">1</xref>&#x2013;<xref ref-type="bibr" rid="ref-5">5</xref>]. Other studies further improve performance through diverse strategies such as federated learning, optimization techniques, and enhanced data processing methods [<xref ref-type="bibr" rid="ref-6">6</xref>&#x2013;<xref ref-type="bibr" rid="ref-10">10</xref>]. More recent works continue to explore advanced learning paradigms and adaptive techniques for intrusion detection [<xref ref-type="bibr" rid="ref-11">11</xref>&#x2013;<xref ref-type="bibr" rid="ref-14">14</xref>]. However, this paper argues that these impressive metrics are often an &#x201C;illusion of high performance&#x201D;. Recent studies confirm that accuracy can be misleading in imbalanced datasets, as it is driven by the model&#x2019;s performance on the majority class while masking failures on critical minority attacks [<xref ref-type="bibr" rid="ref-15">15</xref>&#x2013;<xref ref-type="bibr" rid="ref-17">17</xref>].</p>
<p>This illusion stems from the highly imbalanced nature of NIDS datasets [<xref ref-type="bibr" rid="ref-17">17</xref>&#x2013;<xref ref-type="bibr" rid="ref-21">21</xref>]. As shown in <xref ref-type="table" rid="table-1">Table 1</xref>, the widely used CIC-IDS-2017 dataset is composed of approximately 80% BENIGN traffic. In contrast, several attack classes are represented by extremely few samples&#x2014;for instance, Heartbleed includes only 11 instances, and Infiltration includes just 36 instances. Such extreme class imbalance severely biases learning algorithms toward majority behavior, hindering their ability to generalize to rare but critical attack types. The imbalanced distribution is visualized in <xref ref-type="fig" rid="fig-1">Fig. 1</xref>.</p>
<table-wrap id="table-1">
<label>Table 1</label>
<caption>
<title>Data distribution of the CIC-IDS-2017 dataset, highlighting extreme class imbalance.</title>
</caption>
<table>
<colgroup>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th>Label</th>
<th>Count</th>
</tr>
</thead>
<tbody>
<tr>
<td>BENIGN</td>
<td><bold>2,273,097</bold></td>
</tr>
<tr>
<td>DoS Hulk</td>
<td>231,073</td>
</tr>
<tr>
<td>PortScan</td>
<td>158,930</td>
</tr>
<tr>
<td>DDoS</td>
<td>128,027</td>
</tr>
<tr>
<td>DoS GoldenEye</td>
<td>10,293</td>
</tr>
<tr>
<td>FTP-Patator</td>
<td>7938</td>
</tr>
<tr>
<td>SSH-Patator</td>
<td>5897</td>
</tr>
<tr>
<td>DoS slowloris</td>
<td>5796</td>
</tr>
<tr>
<td>DoS Slowhttptest</td>
<td>5499</td>
</tr>
<tr>
<td>Bot</td>
<td>1966</td>
</tr>
<tr>
<td>Web Attack&#x2014;Brute Force</td>
<td>1507</td>
</tr>
<tr>
<td>Web Attack&#x2014;XSS</td>
<td>652</td>
</tr>
<tr>
<td>Infiltration</td>
<td>36</td>
</tr>
<tr>
<td>Web Attack&#x2014;SQL Injection</td>
<td>21</td>
</tr>
<tr>
<td>Heartbleed</td>
<td>11</td>
</tr>
</tbody>
</table>
<table-wrap-foot>
<fn id="table-1fn1" fn-type="other">
<p>Note: The BENIGN class is highlighted in bold as it represents the dominant class in the dataset.</p>
</fn>
</table-wrap-foot>
</table-wrap><fig id="fig-1">
<label>Figure 1</label>
<caption>
<title>Data Distribution of the CIC-IDS-2017 Dataset.</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="JCS_79097-fig-1.tif"/>
</fig>
<p>Standard deep learning models trained with conventional loss functions such as categorical cross-entropy (<italic>L</italic><sub><italic>CCE</italic></sub><italic>)</italic> are mathematically incentivized to minimize overall error. In imbalanced datasets, this naturally leads the model to focus on the majority classes. This leads to high accuracy and F1 scores, as these metrics are dominated by the model&#x2019;s excellent performance on BENIGN traffic and high-volume attacks. This focus masks the model&#x2019;s total failure to learn the patterns of rare classes. This often results in poor generalization to new or dynamic attacks [<xref ref-type="bibr" rid="ref-1">1</xref>,<xref ref-type="bibr" rid="ref-4">4</xref>]. Critically, this failure occurs because different cyber-attacks are triggered by different sets of features [<xref ref-type="bibr" rid="ref-2">2</xref>,<xref ref-type="bibr" rid="ref-22">22</xref>,<xref ref-type="bibr" rid="ref-23">23</xref>]. Standard models, optimizing only for overall error reduction (<italic>L</italic><sub><italic>CCE</italic></sub>), learn patterns from globally dominant features. These features, while useful for common classes, often act as noise that obscures the subtle, distinct signatures of rare attacks. The model learns spurious correlations from these globally important but locally irrelevant features, effectively drowning out the weak signals of minority classes.</p>
<p>The true measure of a model&#x2019;s ability to protect against all threats is the Macro F1 score, which averages the F1 score of each class equally, giving equal importance to both frequent and rare attacks. It is insensitive to class imbalance and thus better reflects a model&#x2019;s robustness across all attack types. On this metric, standard models perform poorly because they learn a single, static set of rules that is not robust or context-aware [<xref ref-type="bibr" rid="ref-2">2</xref>,<xref ref-type="bibr" rid="ref-22">22</xref>,<xref ref-type="bibr" rid="ref-23">23</xref>]. The features that identify a DDoS flood (e.g., high packet volume) are fundamentally different from those that identify a DoS Slowloris attack (e.g., long flow duration). Furthermore, the features identifying a rare attack like Heartbleed might be subtle variations within features that are otherwise unimportant for BENIGN or DDoS traffic.</p>
<p>To address this gap, this work introduces a Domain Knowledge-guided Attentional Training framework.</p>
<p>The main contributions of this work are as follows:
<list list-type="order">
<list-item>
<p>The primary contribution of this work lies in the proposed knowledge-guided loss function rather than in architectural modifications to the CNN, which is intentionally kept standard to isolate the effect of the proposed training objective.</p></list-item>
<list-item>
<p>This work introduces a new loss formulation, <inline-formula id="ieqn-1"><mml:math id="mml-ieqn-1"><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>K</mml:mi><mml:mi>n</mml:mi><mml:mi>o</mml:mi><mml:mi>w</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mi>d</mml:mi><mml:mi>g</mml:mi><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, which integrates domain knowledge directly into the optimization objective. This loss employs a gradient regularization term that penalizes the model for relying on globally dominant but locally irrelevant features, thereby guiding it to dynamically focus on class-specific, informative features crucial for detecting rare attacks.</p></list-item>
<list-item>
<p>The knowledge term is derived using SHAP (Shapley Additive exPlanations) [<xref ref-type="bibr" rid="ref-23">23</xref>&#x2013;<xref ref-type="bibr" rid="ref-26">26</xref>], which quantifies per-class feature importance from a baseline CNN. The resulting knowledge vectors act as an expert guide, enabling the proposed loss function to regularize training in a class-aware manner.</p></list-item>
<list-item>
<p>The proposed framework was evaluated on the CIC-IDS-2017 dataset, resulting in an improvement in the Macro F1 score (&#x002B;13.8 percentage points) while maintaining competitive overall accuracy and F1 score, indicating that the model is better able to learn minority attack patterns without degrading performance on dominant classes.</p></list-item>
</list></p>
<p>The proposed framework demonstrates an improvement in detecting minority attack classes within the CIC-IDS-2017 dataset. While the baseline CNN achieved high overall performance but failed to detect critical rare attacks such as Heartbleed, the proposed model achieved a Macro F1 score of 0.7560 compared to 0.6180 for the baseline and successfully enhanced the detection of minority threats, including achieving a perfect score for Heartbleed. These outcomes highlight the importance of class-aware, knowledge-guided optimization for addressing the extreme imbalance characteristics of modern intrusion detection datasets.</p>
<p>The remainder of this paper is structured as follows.</p>
<p><bold><xref ref-type="sec" rid="s2">Section 2</xref></bold> presents an overview of existing approaches in network intrusion detection systems.</p>
<p><bold><xref ref-type="sec" rid="s3">Section 3</xref></bold> explains the proposed methodology, including the construction of SHAP-derived knowledge vectors and the knowledge-guided loss function.</p>
<p><bold><xref ref-type="sec" rid="s4">Section 4</xref></bold> details the experimental setup and reports the evaluation results.</p>
<p><bold><xref ref-type="sec" rid="s5">Section 5</xref></bold> discusses the implications of the findings.</p>
<p><bold><xref ref-type="sec" rid="s6">Section 6</xref></bold> concludes the paper and outlines potential directions for future work.</p>
</sec>
<sec id="s2">
<label>2</label>
<title>Related Work</title>
<p>Research on Network Intrusion Detection Systems (NIDS) has explored improvements from several directions, including data handling strategies, feature selection techniques, and model-level enhancements. These approaches aim to strengthen detection performance, address dataset complexity, and improve robustness across diverse attack types. Accordingly, efforts to improve NIDS performance on imbalanced datasets typically fall into three categories:</p>
<sec id="s2_1">
<label>2.1</label>
<title>Data-Level Solutions</title>
<p>These methods focus on rebalancing the dataset, which are broadly categorized into <bold>oversampling</bold>, <bold>undersampling</bold>, and <bold>generative</bold> approaches. Common oversampling techniques include <bold>Random Oversampling</bold> [<xref ref-type="bibr" rid="ref-9">9</xref>,<xref ref-type="bibr" rid="ref-18">18</xref>,<xref ref-type="bibr" rid="ref-19">19</xref>] and <bold>SMOTE</bold> (Synthetic Minority Over-sampling Technique) [<xref ref-type="bibr" rid="ref-3">3</xref>,<xref ref-type="bibr" rid="ref-9">9</xref>,<xref ref-type="bibr" rid="ref-10">10</xref>,<xref ref-type="bibr" rid="ref-18">18</xref>,<xref ref-type="bibr" rid="ref-19">19</xref>], along with its variants like <bold>Borderline SMOTE</bold> [<xref ref-type="bibr" rid="ref-18">18</xref>] and <bold>ADASYN</bold> (Adaptive Synthetic Sampling) [<xref ref-type="bibr" rid="ref-18">18</xref>,<xref ref-type="bibr" rid="ref-19">19</xref>]. <bold>Undersampling</bold> methods, such as <bold>Random Undersampling</bold> [<xref ref-type="bibr" rid="ref-9">9</xref>,<xref ref-type="bibr" rid="ref-18">18</xref>,<xref ref-type="bibr" rid="ref-19">19</xref>], <bold>NearMiss</bold> or <bold>Tomek Links</bold> [<xref ref-type="bibr" rid="ref-19">19</xref>], are also used. While these techniques have shown effectiveness in improving baseline model performance, they cannot be used alone as a solution for class imbalance, as they can either create problems of overfitting or cause the model to learn from noise that does not truly represent real rare attacks [<xref ref-type="bibr" rid="ref-27">27</xref>]. Building upon these traditional data-level strategies, more advanced generative approaches, such as Generative Adversarial Networks (GANs), have been explored to produce higher-fidelity synthetic data [<xref ref-type="bibr" rid="ref-18">18</xref>,<xref ref-type="bibr" rid="ref-19">19</xref>,<xref ref-type="bibr" rid="ref-28">28</xref>]. Specific variants, including IGAN (Imbalanced GAN) [<xref ref-type="bibr" rid="ref-20">20</xref>] and CTGAN (Conditional Tabular GAN) [<xref ref-type="bibr" rid="ref-21">21</xref>], have been applied to NIDS datasets to better model complex minority distributions, though achieving semantic fidelity to real attacks remains an ongoing challenge.</p>
</sec>
<sec id="s2_2">
<label>2.2</label>
<title>Feature-Level Solutions</title>
<p>These solutions aim to find the most impactful subset of features to reduce complexity and noise. Methods range from dimensionality reduction techniques like Principal Component Analysis (PCA) [<xref ref-type="bibr" rid="ref-2">2</xref>,<xref ref-type="bibr" rid="ref-10">10</xref>,<xref ref-type="bibr" rid="ref-13">13</xref>] and feature embedding [<xref ref-type="bibr" rid="ref-13">13</xref>], to filter and wrapper methods like Recursive Feature Elimination (RFE) [<xref ref-type="bibr" rid="ref-24">24</xref>], XGBoost-based importance [<xref ref-type="bibr" rid="ref-1">1</xref>], and Fast Correlation-Based Filter (FCBF) [<xref ref-type="bibr" rid="ref-10">10</xref>]. Other approaches use optimization algorithms like the Honey Badger Optimization (HBO) [<xref ref-type="bibr" rid="ref-22">22</xref>] or XAI methods like SHAP for feature selection [<xref ref-type="bibr" rid="ref-23">23</xref>,<xref ref-type="bibr" rid="ref-24">24</xref>]. This approach has been validated in recent studies, which show that XAI-driven feature selection can significantly improve IDS efficiency [<xref ref-type="bibr" rid="ref-23">23</xref>,<xref ref-type="bibr" rid="ref-24">24</xref>]. While feature selection can maintain high accuracy, <bold>for example, Ahmed et al. [<xref ref-type="bibr" rid="ref-4">4</xref>] achieved 98.79% accuracy with only 20 features, and Chen et al. [<xref ref-type="bibr" rid="ref-24">24</xref>] achieved approximately 98% accuracy with only 15 features</bold>. The fundamental limitation is selecting a single, static subset of features for all situations [<xref ref-type="bibr" rid="ref-1">1</xref>,<xref ref-type="bibr" rid="ref-2">2</xref>,<xref ref-type="bibr" rid="ref-4">4</xref>,<xref ref-type="bibr" rid="ref-10">10</xref>,<xref ref-type="bibr" rid="ref-22">22</xref>,<xref ref-type="bibr" rid="ref-23">23</xref>]. This is suboptimal, as the optimal feature set for a PortScan is different from that of a DoS Slowloris attack. Temporal-aware feature selection strategies are also being explored [<xref ref-type="bibr" rid="ref-14">14</xref>].</p>
</sec>
<sec id="s2_3">
<label>2.3</label>
<title>Model-Level Solutions</title>
<p>These approaches focus on developing more complex architectures or advanced models. Examples include complex hybrid deep learning models like CNN-LSTM [<xref ref-type="bibr" rid="ref-1">1</xref>], CapsNet-BiLSTM [<xref ref-type="bibr" rid="ref-11">11</xref>], or CNN-Decision Forest [<xref ref-type="bibr" rid="ref-2">2</xref>], as well as advanced ensembles [<xref ref-type="bibr" rid="ref-4">4</xref>,<xref ref-type="bibr" rid="ref-5">5</xref>] and general DL/ML hybrid approaches [<xref ref-type="bibr" rid="ref-7">7</xref>]. This category also includes high-performance machine learning models such as K-Nearest Neighbors (KNN) [<xref ref-type="bibr" rid="ref-3">3</xref>] or advanced Random Forest (RF) implementations [<xref ref-type="bibr" rid="ref-9">9</xref>,<xref ref-type="bibr" rid="ref-13">13</xref>]. Other solutions explore lightweight or efficient models, such as federated learning with pruning [<xref ref-type="bibr" rid="ref-6">6</xref>] or optimized Deep Neural Networks (DNNs) [<xref ref-type="bibr" rid="ref-8">8</xref>], and novel training paradigms like contrastive learning [<xref ref-type="bibr" rid="ref-12">12</xref>]. These often achieve high accuracy metrics, with ML models like KNN reaching 99.36% [<xref ref-type="bibr" rid="ref-3">3</xref>] and advanced RF models reaching 99.90% [<xref ref-type="bibr" rid="ref-9">9</xref>]. However, they are still trained using a standard loss function on the same imbalanced data. They are ultimately constrained by the same flawed optimization objective: to minimize error by focusing on the majority class, potentially neglecting rare attack detection.</p>
<p>Our work is distinct from all three. It does not alter the data (Data-Level) or rely on a single, globally static feature subset (Feature-Level) for all attacks. Instead, this work introduces a dynamic, class-aware feature weighting mechanism guided by SHAP-derived knowledge vectors. This approach allows the model to emphasize features that are important for each attack type during training including rare attacks, rather than selecting one fixed subset for all classes.</p>
</sec>
</sec>
<sec id="s3">
<label>3</label>
<title>Proposed Methodology</title>
<p>To address the problem of static optimization that favors majority classes and overlooks minority ones, this paper uses a two-stage, model-agnostic framework. The framework is visualized in <xref ref-type="fig" rid="fig-2">Fig. 2</xref>.</p>
<fig id="fig-2">
<label>Figure 2</label>
<caption>
<title>Overview of the proposed knowledge-guided framework.</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="JCS_79097-fig-2.tif"/>
</fig>
<sec id="s3_1">
<label>3.1</label>
<title>Preprocessing</title>
<p>The CIC-IDS-2017 dataset was formed by loading and merging the provided CSV files. Duplicate entries and all rows containing missing or infinite values were removed to ensure clean, reliable input. All numerical features were then scaled to the [0, 1] range using Min&#x2013;Max normalization, and the class labels were converted to integer form using a LabelEncoder.</p>
<p>After preprocessing, the dataset was divided into training and testing subsets using an 80/20 stratified split. Stratification preserves the original class proportions, which is essential given the extreme imbalance of the dataset and ensures consistent representation of minority attacks in both subsets.</p>
</sec>
<sec id="s3_2">
<label>3.2</label>
<title>Stage 1: Offline Expert Knowledge Annotation</title>
<p>The first stage is a one-time offline pre-processing step designed to create a class-specific knowledge base. By quantifying feature relevance using SHAP before training begins, this offline annotation phase provides a static guide during the active training phase in Stage 2.</p>
<p>The first step involves training a baseline CNN model. Then, SHAP is used to determine the contribution of each feature to the detection of each attack class. SHAP values were calculated for samples belonging to each class, and the mean absolute SHAP value for each feature across the samples of a given class was used to construct the knowledge vector <italic>w</italic> for that class.</p>
<p>To identify critical features for each attack class, SHAP values were aggregated separately per label by computing the mean absolute contribution of each feature over samples belonging to that class. This process produces class-specific feature importance rankings for all attack types. <xref ref-type="fig" rid="fig-3">Fig. 3</xref> visualizes the resulting feature&#x2013;attack relationships using a SHAP-based heatmap, while <xref ref-type="table" rid="table-2">Table 2</xref> summarizes the top-ranked critical features per attack. These results demonstrate that feature relevance is strongly class-dependent, motivating the use of class-specific knowledge vectors in the proposed framework.</p>
<fig id="fig-3">
<label>Figure 3</label>
<caption>
<title>SHAP-based feature&#x2013;attack importance heatmap illustrating class-specific feature relevance across all attack classes on CIC-IDS-2017 dataset.</title>
</caption>
<graphic mimetype="image" mime-subtype="tif" xlink:href="JCS_79097-fig-3.tif"/>
</fig><table-wrap id="table-2">
<label>Table 2</label>
<caption>
<title>Top-ranked SHAP-identified critical features per attack class on CIC-IDS-2017 dataset.</title>
</caption>
<table>
<colgroup>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th>Attack Class</th>
<th>Feature 1</th>
<th>Feature 2</th>
<th>Feature 3</th>
<th>Feature 4</th>
</tr>
</thead>
<tbody>
<tr>
<td><bold>Bot</bold></td>
<td>Destination Port</td>
<td>Push (PSH) Flag Count</td>
<td>Init_Win_bytes<break/>_forward</td>
<td>Acknowledgment (ACK) Flag Count</td>
</tr>
<tr>
<td><bold>DDoS</bold></td>
<td>Average Packet Size</td>
<td>Packet Length Variance</td>
<td>Bwd Packet Length Std</td>
<td>Fwd Packet Length Max</td>
</tr>
<tr>
<td><bold>DoS GoldenEye</bold></td>
<td>Bwd Packet Length Std</td>
<td>Destination Port</td>
<td>Bwd IAT Total</td>
<td>Fwd IAT Max</td>
</tr>
<tr>
<td><bold>DoS Hulk</bold></td>
<td>Bwd Packet Length Std</td>
<td>Destination Port</td>
<td>Fwd IAT Max</td>
<td>Fwd Packet Length Max</td>
</tr>
<tr>
<td><bold>DoS Slowhttptest</bold></td>
<td>Destination Port</td>
<td>PSH Flag Count</td>
<td>Bwd Packet Length Mean</td>
<td>Idle Max</td>
</tr>
<tr>
<td><bold>DoS slowloris</bold></td>
<td>PSH Flag Count</td>
<td>Init_Win_bytes<break/>_forward</td>
<td>Bwd Packet Length Mean</td>
<td>Destination Port</td>
</tr>
<tr>
<td><bold>FTP-Patator</bold></td>
<td>Destination Port</td>
<td>Bwd Inter-Arrival Time (IAT) Max</td>
<td>PSH Flag Count</td>
<td>Bwd IAT Std</td>
</tr>
<tr>
<td><bold>Heartbleed</bold></td>
<td>Subflow Fwd Packets</td>
<td>Bwd Packet Length Std</td>
<td>Flow Duration</td>
<td>Packet Length Mean</td>
</tr>
<tr>
<td><bold>Infiltration</bold></td>
<td>Flow Duration</td>
<td>Subflow Fwd Packets</td>
<td>Fwd Packet Length Max</td>
<td>Total Length of Fwd Packets</td>
</tr>
<tr>
<td><bold>PortScan</bold></td>
<td>PSH Flag Count</td>
<td>Packet Length Mean</td>
<td>Bwd Packets/s</td>
<td>Init_Win_bytes<break/>_forward</td>
</tr>
<tr>
<td><bold>SSH-Patator</bold></td>
<td>Bwd IAT Total</td>
<td>Fwd IAT Max</td>
<td>Destination Port</td>
<td>Bwd IAT Max</td>
</tr>
<tr>
<td><bold>Brute Force</bold></td>
<td>Init_Win_bytes<break/>_backward</td>
<td>Init_Win_bytes<break/>_forward</td>
<td>Fwd IAT Std</td>
<td>Fwd IAT Total</td>
</tr>
<tr>
<td><bold>SQL Injection</bold></td>
<td>Bwd IAT Max</td>
<td>Min Packet Length</td>
<td>Flow IAT Max</td>
<td>Bwd Packet Length Std</td>
</tr>
<tr>
<td><bold>XSS</bold></td>
<td>Init_Win_bytes<break/>_backward</td>
<td>Init_Win_bytes<break/>_forward</td>
<td>Packet Length Mean</td>
<td>Fwd IAT Std</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>This work generates 14 knowledge vectors corresponding to the 14 attack classes. Each vector contains 78 elements, where each element indicates whether the associated feature contributes to the identification of that attack class. Features with zero SHAP contribution for a given class are assigned a value of 0 in the corresponding knowledge vector, marking them as irrelevant for that attack. This aggregation yields a robust estimate of feature importance per class.
<list list-type="bullet">
<list-item>
<p>If <italic>w</italic><sub><italic>j</italic></sub> is low (equal 0), feature <bold><italic>j</italic></bold> is unimportant or misleading for the attack corresponding to the sample.</p></list-item>
<list-item>
<p>If <italic>w</italic><sub><italic>j</italic></sub> is high (equal 1), feature <bold><italic>j</italic></bold> is critical for the attack corresponding to the sample. This process is performed only once to create a data-driven guide on a per-class basis.</p></list-item>
</list></p>
</sec>
<sec id="s3_3">
<label>3.3</label>
<title>Stage 2: Knowledge-Guided Training</title>
<p>The core innovation of our framework is a novel loss function used to train a standard CNN. A typical model is trained using only the Categorical Cross-Entropy (<italic>L</italic><sub><italic>CCE</italic></sub>) loss, which measures predictive correctness, as defined in <xref ref-type="disp-formula" rid="eqn-1">Eq. (1)</xref>.
<disp-formula id="eqn-1"><label>(1)</label><mml:math id="mml-eqn-1" display="block"><mml:mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true"><mml:mtr><mml:mtd></mml:mtd><mml:mtd><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>C</mml:mi><mml:mi>C</mml:mi><mml:mi>E</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo>&#x2212;</mml:mo><mml:munderover><mml:mo>&#x2211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:munderover><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mi>log</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mrow><mml:mrow><mml:mover><mml:mtext>y</mml:mtext><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>
<p>As discussed, <italic>L</italic><sub><italic>CCE</italic></sub> inherently favors majority classes in imbalanced datasets, as minimizing the overall loss is more easily achieved by correctly classifying the dominant BENIGN class. Consequently, gradients from minority (rare) attack classes contribute less to the total loss, leading the model to underfit or overlook them.</p>
<p>The total loss is defined as the sum of the conventional categorical cross-entropy and a knowledge-guided regularization term, <inline-formula id="ieqn-2"><mml:math id="mml-ieqn-2"><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>K</mml:mi><mml:mi>n</mml:mi><mml:mi>o</mml:mi><mml:mi>w</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mi>d</mml:mi><mml:mi>g</mml:mi><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>, which mitigates bias toward globally dominant features and enhances rare-attack detection by dynamically enforcing focus on SHAP-derived, class-specific critical features for each attack type. The regularization term <inline-formula id="ieqn-3"><mml:math id="mml-ieqn-3"><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>K</mml:mi><mml:mi>n</mml:mi><mml:mi>o</mml:mi><mml:mi>w</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mi>d</mml:mi><mml:mi>g</mml:mi><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> depends on the knowledge vector corresponding to the attack class of the sample for which the loss is being calculated.</p>
<p>The total loss function and its knowledge-guided regularization component are defined in <xref ref-type="disp-formula" rid="eqn-2">Eqs. (2)</xref> and <xref ref-type="disp-formula" rid="eqn-3">(3)</xref>, respectively.
<disp-formula id="eqn-2"><label>(2)</label><mml:math id="mml-eqn-2" display="block"><mml:mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true"><mml:mtr><mml:mtd></mml:mtd><mml:mtd><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>t</mml:mi><mml:mi>o</mml:mi><mml:mi>t</mml:mi><mml:mi>a</mml:mi><mml:mi>l</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>C</mml:mi><mml:mi>C</mml:mi><mml:mi>E</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:mi>&#x03BB;</mml:mi><mml:mo>&#x22C5;</mml:mo><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>K</mml:mi><mml:mi>n</mml:mi><mml:mi>o</mml:mi><mml:mi>w</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mi>d</mml:mi><mml:mi>g</mml:mi><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
<disp-formula id="eqn-3"><label>(3)</label><mml:math id="mml-eqn-3" display="block"><mml:mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true"><mml:mtr><mml:mtd></mml:mtd><mml:mtd><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>K</mml:mi><mml:mi>n</mml:mi><mml:mi>o</mml:mi><mml:mi>w</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mi>d</mml:mi><mml:mi>g</mml:mi><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:munderover><mml:mo>&#x2211;</mml:mo><mml:mrow><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:munderover><mml:mo stretchy="false">(</mml:mo><mml:mn>1</mml:mn><mml:mo>&#x2212;</mml:mo><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mfrac><mml:mrow><mml:mi mathvariant="normal">&#x2202;</mml:mi><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>C</mml:mi><mml:mi>C</mml:mi><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi mathvariant="normal">&#x2202;</mml:mi><mml:msub><mml:mi>x</mml:mi><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>where the terms are defined as:
<list list-type="bullet">
<list-item>
<p><inline-formula id="ieqn-4"><mml:math id="mml-ieqn-4"><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> is the SHAP-derived expert importance for feature <italic>j</italic> for the attack type belonging to the true sample</p></list-item>
<list-item>
<p><inline-formula id="ieqn-5"><mml:math id="mml-ieqn-5"><mml:mfrac><mml:mrow><mml:mi mathvariant="bold">&#x2202;</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">L</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mi mathvariant="bold-italic">C</mml:mi><mml:mi mathvariant="bold-italic">E</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi mathvariant="bold">&#x2202;</mml:mi><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac></mml:math></inline-formula> is the input gradient, which measures the sensitivity of the model&#x2019;s error to a change in input feature <italic>j</italic>, which quantifies how much the model is relying on this feature for its prediction.</p></list-item>
</list></p>
<p>The gradient term is squared to ensure that both positive and negative sensitivities contribute equally to the penalty, emphasizing overall reliance magnitude rather than direction.</p>
<p><bold>Mechanism of Action:</bold></p>
<p>This loss function creates a dynamic and knowledge-based penalty:
<list list-type="bullet">
<list-item>
<p><bold>If a feature <italic>j</italic> is unimportant </bold><inline-formula id="ieqn-6"><mml:math id="mml-ieqn-6"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:mtext mathvariant="bold">0</mml:mtext></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula><bold>:</bold> The <inline-formula id="ieqn-7"><mml:math id="mml-ieqn-7"><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mtext mathvariant="bold">1</mml:mtext></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> term becomes 1. The model receives the full penalty for relying on this irrelevant feature.</p></list-item>
<list-item>
<p><bold>If a feature <italic>j</italic> is important </bold><inline-formula id="ieqn-8"><mml:math id="mml-ieqn-8"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:mtext mathvariant="bold">1</mml:mtext></mml:mrow><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula><bold>:</bold> The <inline-formula id="ieqn-9"><mml:math id="mml-ieqn-9"><mml:mo stretchy="false">(</mml:mo><mml:mrow><mml:mtext mathvariant="bold">1</mml:mtext></mml:mrow><mml:mo>&#x2212;</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">j</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula> term becomes 0. The penalty is zeroed out. The model is allowed to rely on this feature.</p></list-item>
</list></p>
<p>This total loss function introduces a dual optimization objective: the model is designed to minimize classification error while placing greater emphasis on SHAP-identified, class-relevant features for each sample&#x2019;s true class. By penalizing reliance on globally dominant but class-irrelevant features, <inline-formula id="ieqn-10"><mml:math id="mml-ieqn-10"><mml:msub><mml:mi mathvariant="bold-italic">L</mml:mi><mml:mrow><mml:mi>K</mml:mi><mml:mi>n</mml:mi><mml:mi>o</mml:mi><mml:mi>w</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mi>d</mml:mi><mml:mi>g</mml:mi><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> reduces the influence of misleading global patterns, particularly when analyzing rare attacks that depend on subtle, locally important signals. As a result, this mechanism encourages the model to reduce noise and focus on class-specific feature relationships, leading to improved detection performance on minority attack classes.</p>
<p>The effectiveness of the proposed Knowledge-guided framework is evaluated in the following section.</p>
</sec>
</sec>
<sec id="s4">
<label>4</label>
<title>Experimental Setup and Results</title>
<p>This section describes the computational environment, experimental configuration, model architecture, and evaluation procedure used to assess the proposed knowledge-guided framework.</p>
<sec id="s4_1">
<label>4.1</label>
<title>Experimental Setup</title>
<p><bold>Hardware:</bold></p>
<p>All experiments were conducted on Google Colab using an NVIDIA T4 GPU with 16 GB of GPU memory.</p>
<p><bold>Software:</bold></p>
<p>The experiments were implemented in Python 3.10 using TensorFlow 2.17, Scikit-learn 1.3.2, Pandas 2.2.2, NumPy 1.26.4, and Matplotlib 3.8.4, with GPU acceleration enabled.</p>
<p><bold>Model Architecture:</bold></p>
<p>Both the baseline and Knowledge-guided models employed the same standard CNN architecture using TensorFlow Keras.
<list list-type="bullet">
<list-item>
<p>Input Layer (shape &#x003D; (78))</p></list-item>
<list-item>
<p>Reshape Layer (target_shape &#x003D; (78, 1))</p></list-item>
<list-item>
<p>Conv1D (filters &#x003D; 32, kernel_size &#x003D; 3, activation &#x003D; &#x2018;relu&#x2019;, padding &#x003D; &#x2018;same&#x2019;)</p></list-item>
<list-item>
<p>MaxPooling1D (pool_size &#x003D; 2)</p></list-item>
<list-item>
<p>Conv1D (filters &#x003D; 64, kernel_size &#x003D; 3, activation &#x003D; &#x2018;relu&#x2019;, padding &#x003D; &#x2018;same&#x2019;)</p></list-item>
<list-item>
<p>MaxPooling1D (pool_size &#x003D; 2)</p></list-item>
<list-item>
<p>Flatten Layer</p></list-item>
<list-item>
<p>Dense Layer (units &#x003D; 128, activation &#x003D; &#x2018;relu&#x2019;)</p></list-item>
<list-item>
<p>Output Dense Layer (units &#x003D; 15, activation &#x003D; &#x2018;softmax&#x2019;)</p></list-item>
</list></p>
<p>It is important to note that the architectural components of the CNN remain unchanged; the proposed contribution is introduced exclusively at the loss-function level during training, where domain knowledge is integrated through gradient regularization.</p>
<p><bold>Training Hyperparameters:</bold></p>
<p><bold>Baseline:</bold> Adam optimizer with learning rate 0.001, <inline-formula id="ieqn-11"><mml:math id="mml-ieqn-11"><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>C</mml:mi><mml:mi>C</mml:mi><mml:mi>E</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> loss (with label smoothing 0.05 added for evaluation comparability). Batch Size: 256. Trained for 10 epochs (implicit, weights loaded).</p>
<p><bold>Knowledge-Guided:</bold>
<list list-type="bullet">
<list-item>
<p>Phase 1 (2 epochs with <inline-formula id="ieqn-12"><mml:math id="mml-ieqn-12"><mml:mi>&#x03BB;</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math></inline-formula> from <xref ref-type="disp-formula" rid="eqn-2">Eq. (2)</xref>) ensures the model first captures the <italic>global feature structure</italic> before the per-class SHAP regularization is applied.</p></list-item>
<list-item>
<p>Phase 2 (8 epochs with <inline-formula id="ieqn-13"><mml:math id="mml-ieqn-13"><mml:mi>&#x03BB;</mml:mi><mml:mo>=</mml:mo><mml:mn>0.2</mml:mn></mml:math></inline-formula> from <xref ref-type="disp-formula" rid="eqn-2">Eq. (2)</xref>, selected based on sensitivity analysis; see <xref ref-type="sec" rid="s4_4">Section 4.4</xref>) applies the per-class SHAP regularization to enhance the detection of minority attack patterns.</p></list-item>
</list></p>
<p><bold>Dataset:</bold></p>
<p>This work uses the CIC-IDS-2017 dataset as the primary dataset, which contains over 2.8 million network flows across 15 classes (1 benign and 14 attack types), each described by 78 features. As shown in <xref ref-type="table" rid="table-1">Table 1</xref>, the dataset exhibits severe class imbalance.</p>

<p>In addition to CIC-IDS-2017, supplementary evaluations were conducted on the NSL-KDD and UNSW_NB15 benchmark datasets to assess the robustness of the proposed framework under different data distributions.</p>
<p>Unless otherwise stated, all detailed analyses, comparisons with state-of-the-art methods, and per-class evaluations are conducted on the CIC-IDS-2017 dataset, while NSL-KDD and UNSW_NB15 are used solely for supplementary sensitivity and robustness analysis.</p>
<p><bold>Evaluation Metrics:</bold></p>
<p>The performance of both the baseline and the proposed knowledge-guided model was assessed using accuracy, F1 score, and Macro F1 score. The equations for these metrics are as follows.
<disp-formula id="ueqn-4"><mml:math id="mml-ueqn-4" display="block"><mml:mi>A</mml:mi><mml:mi>c</mml:mi><mml:mi>c</mml:mi><mml:mi>u</mml:mi><mml:mi>r</mml:mi><mml:mi>a</mml:mi><mml:mi>c</mml:mi><mml:mi>y</mml:mi><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mi>T</mml:mi><mml:mi>P</mml:mi><mml:mo>+</mml:mo><mml:mi>T</mml:mi><mml:mi>N</mml:mi></mml:mrow><mml:mrow><mml:mi>T</mml:mi><mml:mi>P</mml:mi><mml:mo>+</mml:mo><mml:mi>T</mml:mi><mml:mi>N</mml:mi><mml:mo>+</mml:mo><mml:mi>F</mml:mi><mml:mi>P</mml:mi><mml:mo>+</mml:mo><mml:mi>F</mml:mi><mml:mi>N</mml:mi></mml:mrow></mml:mfrac></mml:math></disp-formula>
<disp-formula id="ueqn-5"><mml:math id="mml-ueqn-5" display="block"><mml:mi>F</mml:mi><mml:mn>1</mml:mn><mml:mspace width="thinmathspace"></mml:mspace><mml:mi>S</mml:mi><mml:mi>c</mml:mi><mml:mi>o</mml:mi><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mn>2</mml:mn><mml:mo>&#x2217;</mml:mo><mml:mo stretchy="false">(</mml:mo><mml:mi>P</mml:mi><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mi>i</mml:mi><mml:mi>s</mml:mi><mml:mi>i</mml:mi><mml:mi>o</mml:mi><mml:mi>n</mml:mi><mml:mo>&#x2217;</mml:mo><mml:mi>R</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mi>a</mml:mi><mml:mi>l</mml:mi><mml:mi>l</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:mi>P</mml:mi><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mi>i</mml:mi><mml:mi>s</mml:mi><mml:mi>i</mml:mi><mml:mi>o</mml:mi><mml:mi>n</mml:mi><mml:mo>+</mml:mo><mml:mi>R</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mi>a</mml:mi><mml:mi>l</mml:mi><mml:mi>l</mml:mi></mml:mrow></mml:mfrac></mml:math></disp-formula>
<disp-formula id="ueqn-6"><mml:math id="mml-ueqn-6" display="block"><mml:mi>M</mml:mi><mml:mi>a</mml:mi><mml:mi>c</mml:mi><mml:mi>r</mml:mi><mml:mi>o</mml:mi><mml:mi>F</mml:mi><mml:mn>1</mml:mn><mml:mspace width="thinmathspace"></mml:mspace><mml:mi>S</mml:mi><mml:mi>c</mml:mi><mml:mi>o</mml:mi><mml:mi>r</mml:mi><mml:mi>e</mml:mi><mml:mo>=</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mi>C</mml:mi></mml:mfrac><mml:munderover><mml:mo>&#x2211;</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:mrow><mml:mrow><mml:mi>c</mml:mi></mml:mrow></mml:munderover></mml:math></disp-formula></p>
</sec>
<sec id="s4_2">
<label>4.2</label>
<title>Baseline Model Performance: The Illusion of High Performance</title>
<p>An initial evaluation was performed on the standard CNN baseline. The results are shown in <xref ref-type="table" rid="table-3">Table 3</xref>. The baseline model achieved 99.39% accuracy and a 0.9933 F1 score. These metrics, heavily weighted by the BENIGN class, are comparable to many SOTA results (See <xref ref-type="table" rid="table-4">Table 4</xref>), suggesting a near-perfect model according to standard evaluation practices.</p>
<table-wrap id="table-3">
<label>Table 3</label>
<caption>
<title>Comparison of overall performance between the baseline CNN and the proposed Knowledge-Guided CNN.</title>
</caption>
<table>
<colgroup>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th>Model</th>
<th>Accuracy</th>
<th>F1 Score</th>
<th>Macro F1 Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Baseline CNN</td>
<td>99.39%</td>
<td>0.9933</td>
<td>0.6180</td>
</tr>
<tr>
<td>Proposed KG CNN</td>
<td>99.56%</td>
<td>0.9952</td>
<td>0.7560</td>
</tr>
<tr>
<td>Improvement</td>
<td>&#x002B;0.170%</td>
<td>&#x002B;0.0019</td>
<td>&#x002B;0.138</td>
</tr>
</tbody>
</table>
</table-wrap><table-wrap id="table-4">
<label>Table 4</label>
<caption>
<title>Comparison of accuracy and F1 score with State-of-the-Art methods.</title>
</caption>
<table>
<colgroup>
<col align="center"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th>Method</th>
<th>Accuracy</th>
<th>F1 Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bandarupalli [<xref ref-type="bibr" rid="ref-8">8</xref>] (DNN)</td>
<td>97.62%</td>
<td>0.6716</td>
</tr>
<tr>
<td>Ahmed et al. [<xref ref-type="bibr" rid="ref-4">4</xref>] (BMA Ensemble)</td>
<td>98.79%</td>
<td>0.9879</td>
</tr>
<tr>
<td>Ali et al. [<xref ref-type="bibr" rid="ref-3">3</xref>] (KNN)</td>
<td>99.88%</td>
<td>0.9746</td>
</tr>
<tr>
<td>Ali Afraji et al. [<xref ref-type="bibr" rid="ref-29">29</xref>] (CNN&#x2013;LSTM&#x2013;GRU)</td>
<td>99.49%</td>
<td>0.9949</td>
</tr>
<tr>
<td>Sharma [<xref ref-type="bibr" rid="ref-11">11</xref>] (CapsNet &#x002B; BiLSTM)</td>
<td>99.00%</td>
<td>0.9800</td>
</tr>
<tr>
<td>Almuhanna and Dardouri [<xref ref-type="bibr" rid="ref-7">7</xref>] (DL/ML)</td>
<td>100%</td>
<td>1.0</td>
</tr>
<tr>
<td>Bouayad et al. [<xref ref-type="bibr" rid="ref-6">6</xref>] (Federated DL)</td>
<td>99.58%</td>
<td>0.9938</td>
</tr>
<tr>
<td>Talukder et al. [<xref ref-type="bibr" rid="ref-13">13</xref>] (RF)</td>
<td>99.95%</td>
<td>0.9995</td>
</tr>
<tr>
<td>Soumik [<xref ref-type="bibr" rid="ref-9">9</xref>] (Random Forest)</td>
<td>99.90%</td>
<td>0.9741</td>
</tr>
<tr>
<td>Our Baseline CNN</td>
<td>99.40%</td>
<td>0.9930</td>
</tr>
<tr>
<td>Our Proposed KG CNN</td>
<td>99.56%</td>
<td>0.9950</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>However, the Macro F1 score was only 0.6180. A detailed per-class analysis in <xref ref-type="table" rid="table-5">Table 5</xref> highlights a critical limitation masked by the high overall metrics: the baseline achieved an F1 score of 0.0 on Heartbleed and Infiltration. The model failed to detect these attack types, reinforcing the misleading nature of the high overall metrics.</p>
<table-wrap id="table-5">
<label>Table 5</label>
<caption>
<title>Per-class F1 score comparison (ordered by absolute improvement).</title>
</caption>
<table>
<colgroup>
<col align="center"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th>Class</th>
<th>Baseline F1 Score</th>
<th>Proposed KG F1 Score</th>
</tr>
</thead>
<tbody>
<tr>
<td><bold>Heartbleed</bold></td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td><bold>Infiltration</bold></td>
<td>0</td>
<td>0.60</td>
</tr>
<tr>
<td><bold>SSH-Patator</bold></td>
<td>0.6823</td>
<td>0.9674</td>
</tr>
<tr>
<td><bold>Web Attack&#x2014;Brute Force</bold></td>
<td>0.0935</td>
<td>0.2176</td>
</tr>
<tr>
<td><bold>Web Attack&#x2014;XSS</bold></td>
<td>0.0000</td>
<td>0.0735</td>
</tr>
<tr>
<td><bold>FTP-Patator</bold></td>
<td>0.9906</td>
<td>0.9959</td>
</tr>
<tr>
<td><bold>PortScan</bold></td>
<td>0.9934</td>
<td>0.9959</td>
</tr>
<tr>
<td><bold>DoS Hulk</bold></td>
<td>0.9830</td>
<td>0.9865</td>
</tr>
<tr>
<td><bold>DoS slowloris</bold></td>
<td>0.9813</td>
<td>0.9875</td>
</tr>
<tr>
<td><bold>DoS GoldenEye</bold></td>
<td>0.9876</td>
<td>0.9878</td>
</tr>
<tr>
<td><bold>BENIGN</bold></td>
<td>0.9963</td>
<td>0.9973</td>
</tr>
<tr>
<td><bold>DDoS</bold></td>
<td>0.9984</td>
<td>0.9986</td>
</tr>
<tr>
<td><bold>Bot</bold></td>
<td>0.5802</td>
<td>0.5884</td>
</tr>
<tr>
<td><bold>DoS Slowhttptest</bold></td>
<td>0.9837</td>
<td>0.9436</td>
</tr>
<tr>
<td><bold>Web Attack&#x2014;SQL Injection</bold></td>
<td>0.0000</td>
<td>0.0000</td>
</tr>
</tbody>
</table>
</table-wrap>
</sec>
<sec id="s4_3">
<label>4.3</label>
<title>Knowledge-Guided Model Performance: Solving the Imbalance Problem</title>
<p>The proposed knowledge-guided framework, which uses the <inline-formula id="ieqn-14"><mml:math id="mml-ieqn-14"><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mrow><mml:mtext>Knowledge</mml:mtext></mml:mrow></mml:mrow></mml:msub></mml:math></inline-formula> loss function, was then evaluated.</p>
<p>As shown in <xref ref-type="table" rid="table-3">Table 3</xref>, the Knowledge-guided model achieved a Macro F1 score of 0.7560, representing a 13.8 percentage-point absolute gain over the baseline. Importantly, this substantial improvement in class-agnostic robustness was achieved while maintaining high overall accuracy (99.56%) and F1 score (0.9952) at levels comparable to the baseline and other state-of-the-art methods (see <xref ref-type="table" rid="table-4">Table 4</xref>). These results indicate that the proposed approach improves minority class detection without sacrificing performance on standard evaluation metrics.</p>

</sec>
<sec id="s4_4">
<label>4.4</label>
<title>Sensitivity Analysis of the Knowledge-Guided Regularization Parameter <bold>&#x03BB;</bold></title>
<p>While &#x03BB; &#x003D; 0.2 was used in the main experiments, its selection was not arbitrary. To evaluate the robustness of the proposed framework and to analyze the impact of &#x03BB; on model performance, a sensitivity analysis was conducted by training the model with multiple &#x03BB; values: 0.01, 0.1, 0.2, and 0.3.</p>
<p><xref ref-type="table" rid="table-6">Table 6</xref> reports the corresponding evaluation metrics. When &#x03BB; is very small (&#x03BB; &#x003D; 0.01), the effect of the regularization term is weak, and the model&#x2019;s behavior remains close to that of the baseline CNN, resulting in limited improvement in Macro F1 score. Increasing &#x03BB; to 0.1 yields a modest improvement, indicating that suppressing reliance on class-irrelevant features begins to positively affect minority-class detection. The best overall performance is achieved at &#x03BB; &#x003D; 0.2, which produces the highest accuracy, F1 score, and Macro F1 score. This value represents an effective balance between enforcing class-specific feature focus and preserving sufficient model flexibility. Further increasing &#x03BB; to 0.3 leads to a decline in Macro F1 score, indicating the onset of over-regularization.</p>
<table-wrap id="table-6">
<label>Table 6</label>
<caption>
<title>Sensitivity analysis of the Knowledge-Guided regularization parameter &#x03BB; on CIC-IDS-2017 dataset.</title>
</caption>
<table>
<colgroup>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th>&#x03BB; Value</th>
<th>Accuracy</th>
<th>F1 Score</th>
<th>Macro F1 Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>0.01</td>
<td>98.43</td>
<td>0.9839</td>
<td>0.7186</td>
</tr>
<tr>
<td>0.10</td>
<td>98.43</td>
<td>0.9841</td>
<td>0.7212</td>
</tr>
<tr>
<td><bold>0.20</bold></td>
<td><bold>99.56</bold></td>
<td><bold>0.9952</bold></td>
<td><bold>0.7560</bold></td>
</tr>
<tr>
<td>0.30</td>
<td>98.40</td>
<td>0.9836</td>
<td>0.7037</td>
</tr>
</tbody>
</table>
<table-wrap-foot>
<fn id="table-6fn1" fn-type="other">
<p>Note: Bold values indicate the best overall performance across the tested &#x03BB; values on the CIC-IDS-2017 dataset.</p>
</fn>
</table-wrap-foot>
</table-wrap>
<p>The two-stage training schedule was designed to stabilize optimization when introducing the knowledge-guided regularization term. A short warm-up phase (&#x03BB; &#x003D; 0) allows the model to first learn global feature representations before applying class-specific constraints. Preliminary experiments with shorter warm-up durations (e.g., 1 epoch) led to unstable training, while longer warm-up phases reduced the impact of the knowledge-guided loss. Similarly, allocating fewer than 8 epochs to the knowledge-guided phase resulted in incomplete convergence, whereas extending this phase did not yield additional gains. Based on these observations, the 2 &#x002B; 8 epoch schedule was selected as an effective and stable trade-off.</p>
<p><xref ref-type="table" rid="table-4">Table 4</xref> compares the performance of the proposed and baseline models with state-of-the-art methods on the CIC-IDS-2017 dataset.</p>

<p><xref ref-type="table" rid="table-5">Table 5</xref> presents the per-class F1 score comparison, illustrating the detailed contribution to the overall Macro F1 improvement. The knowledge-guided (KG) model, driven by the proposed loss function to learn class-specific patterns, achieved substantial gains on rare attack classes, <bold>while maintaining consistent performance on majority classes</bold>.</p>

<p><xref ref-type="table" rid="table-6">Table 6</xref> presents the sensitivity analysis of the proposed knowledge-guided framework with respect to different values of the regularization parameter &#x03BB; on CIC-IDS-2017 dataset.</p>

<p><xref ref-type="table" rid="table-7">Table 7</xref> presents the sensitivity analysis of the proposed knowledge-guided framework with respect to different values of the regularization parameter &#x03BB; on NSL-KDD Dataset.</p>
<table-wrap id="table-7">
<label>Table 7</label>
<caption>
<title>Sensitivity analysis of the Knowledge-Guided regularization parameter &#x03BB; on NSL-KDD Dataset.</title>
</caption>
<table>
<colgroup>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th>&#x03BB; Value</th>
<th>Accuracy</th>
<th>F1 Score</th>
<th>Macro F1 Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>0 (Baseline)</td>
<td>75.84</td>
<td>0.5469</td>
<td>0.7296</td>
</tr>
<tr>
<td>0.01</td>
<td>75.95</td>
<td>0.5897</td>
<td>0.7362</td>
</tr>
<tr>
<td>0.10</td>
<td>75.92</td>
<td>0.5995</td>
<td>0.7351</td>
</tr>
<tr>
<td>0.20</td>
<td>76.45</td>
<td>0.5976</td>
<td>0.7400</td>
</tr>
<tr>
<td><bold>0.30</bold></td>
<td><bold>76.37</bold></td>
<td><bold>0.6159</bold></td>
<td><bold>0.7438</bold></td>
</tr>
</tbody>
</table>
<table-wrap-foot>
<fn id="table-7fn1" fn-type="other">
<p>Note: Bold values indicate the best overall performance across the tested &#x03BB; values on the NSL-KDD dataset.</p>
</fn>
</table-wrap-foot>
</table-wrap>
<p><xref ref-type="table" rid="table-8">Table 8</xref> presents the sensitivity analysis of the proposed Knowledge-guided framework with respect to different values of the regularization parameter &#x03BB; on UNSW_NB15 Dataset.</p>
<table-wrap id="table-8">
<label>Table 8</label>
<caption>
<title>Sensitivity analysis of the Knowledge-Guided regularization parameter &#x03BB; on UNSW_NB15.</title>
</caption>
<table>
<colgroup>
<col align="center"/>
<col align="center"/>
<col align="center"/>
<col align="center"/>
</colgroup>
<thead>
<tr>
<th>&#x03BB; Value</th>
<th>Accuracy</th>
<th>F1 Score</th>
<th>Macro F1 Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>0 (Baseline)</td>
<td>69.76</td>
<td>0.3883</td>
<td>0.6957</td>
</tr>
<tr>
<td><bold>0.01</bold></td>
<td><bold>72.90</bold></td>
<td><bold>0.4412</bold></td>
<td><bold>0.7129</bold></td>
</tr>
<tr>
<td>0.10</td>
<td>72.05</td>
<td>0.4368</td>
<td>0.7156</td>
</tr>
<tr>
<td>0.20</td>
<td>72.22</td>
<td>0.4364</td>
<td>0.7175</td>
</tr>
<tr>
<td>0.30</td>
<td>71.59</td>
<td>0.4305</td>
<td>0.7126</td>
</tr>
</tbody>
</table>
<table-wrap-foot>
<fn id="table-8fn1" fn-type="other">
<p>Note: Bold values indicate the best overall performance across the tested &#x03BB; values on the UNSW_NB15 dataset.</p>
</fn>
</table-wrap-foot>
</table-wrap>
<p>Since imbalance-aware regularization controls the degree of feature concentration toward minority classes, its strength must be adapted to the dataset&#x2019;s imbalance structure; reusing the same &#x03BB; across datasets can lead to excessive constraint in scenarios with different class distributions.</p>
<p>The following section discusses these results and provides further analysis.</p>
</sec>
</sec>
<sec id="s5">
<label>5</label>
<title>Discussion</title>
<p>The results in <xref ref-type="sec" rid="s4">Section 4</xref> provide empirical evidence for the observed behavior of the baseline model. When trained solely with the conventional loss function <inline-formula id="ieqn-15"><mml:math id="mml-ieqn-15"><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mrow><mml:mtext>CCE</mml:mtext></mml:mrow></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:math></inline-formula>, the model tends to converge toward a majority-driven local minimum. Because the dataset is dominated by BENIGN traffic (approximately 80%) and several high-frequency attack classes, the optimization process prioritizes these categories, resulting in high overall accuracy and F1 scores comparable to state-of-the-art reports. However, this behavior causes the model to rely heavily on globally dominant features that maximize aggregate performance but introduce noise when analyzing minority classes such as Heartbleed.</p>
<p>Focal loss and class-balanced loss are commonly used imbalance-aware objectives that address class imbalance by reweighting samples or classes during training. Focal loss emphasizes hard-to-classify samples, while class-balanced loss compensates for unequal class frequencies. However, these methods operate at the sample or class level and do not explicitly constrain which features the model relies on for each attack type.</p>
<p>The proposed gradient regularization term scales linearly with the number of input features, as it operates directly on input gradients. While this is computationally feasible for flow-based representations such as CIC-IDS-2017 with 78 features, higher-dimensional inputs or deep feature embeddings would increase computational cost. Future work will explore sparse regularization, feature grouping, or embedding-level constraints to extend the framework to higher-dimensional representations.</p>
<p>The knowledge-guided component of the loss function plays an important role during training by increasing the penalty whenever the model depends on features that SHAP analysis identifies as irrelevant for the corresponding class. This mechanism reduces the model&#x2019;s sensitivity to globally dominant but misleading features and directs learning toward patterns that are more strongly associated with minority attacks. The resulting improvement of 13.8 percentage points in Macro F1 score highlights the impact of this constraint on class-agnostic generalization. Achieving an F1 score of 1.0 for the Heartbleed class and a marked improvement for Infiltration further demonstrates the effectiveness of the proposed framework in extracting meaningful representations from highly underrepresented classes. Importantly, these gains are achieved without degrading performance on majority classes, as reflected by the accuracy and F1 values reported in <xref ref-type="table" rid="table-4">Table 4</xref>.</p>

<p>Some limitations remain where the proposed knowledge-guided (KG) model does not show significant improvement. In particular, the model fails to detect Web Attack&#x2014;SQL Injection and performs poorly on Web Attack&#x2014;XSS and Web Attack&#x2014;Brute Force, although the latter two classes show modest gains over the baseline F1 scores of 0.0, 0.0, and 0.0935, respectively (<xref ref-type="table" rid="table-5">Table 5</xref>). This behavior is likely due to two compounding factors. First, Web Attack&#x2014;SQL Injection and Web Attack&#x2014;XSS are primarily characterized by malicious patterns embedded within application-layer payloads (e.g., SQL commands or injected JavaScript), which are not captured by the flow-based network features available in the CIC-IDS-2017 dataset. As a result, neither the baseline nor the KG model has access to the information required to reliably distinguish such payload-dependent attacks.</p>

<p>Second, the dataset contains extremely few samples for these classes (e.g., only 21 total samples for SQL Injection, 652 for XSS, and 1507 for Web Brute Force&#x2014;<bold>Table 1</bold>). Our method relies on SHAP in Stage 1 to generate good knowledge vectors. If there are too few samples, SHAP analysis may struggle to identify statistically significant or stable feature importance patterns. Recent studies have confirmed that SHAP&#x2019;s stability and statistical significance can be compromised in scenarios with very small sample sizes or sparse data, as the explanations can fluctuate and may lack statistical power [<xref ref-type="bibr" rid="ref-26">26</xref>,<xref ref-type="bibr" rid="ref-27">27</xref>]. Consequently, the knowledge guide (<inline-formula id="ieqn-16"><mml:math id="mml-ieqn-16"><mml:msub><mml:mi>w</mml:mi><mml:mrow><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula>) for these classes might be weak or unreliable, limiting the effectiveness of the <inline-formula id="ieqn-17"><mml:math id="mml-ieqn-17"><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>K</mml:mi><mml:mi>n</mml:mi><mml:mi>o</mml:mi><mml:mi>w</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mi>d</mml:mi><mml:mi>g</mml:mi><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> term during training.</p>
<p>Furthermore, it is important to note that the effectiveness of the proposed knowledge-guided framework is inherently dependent on the quality of the baseline model used to generate SHAP knowledge vectors. For the Bot class, the model saw no meaningful improvement (0.5802 to 0.5884 F1 score), even though this class (1966 samples) is not as resource-starved as the Web Attack classes. This highlights a key dependency of our method: the quality of the knowledge guide is contingent on the baseline model&#x2019;s performance from which SHAP values are derived. The baseline model itself performed poorly on the Bot class (0.58 F1 score), suggesting that it learned spurious or weak correlations. Consequently, the SHAP-derived knowledge generated in Stage 1 was likely suboptimal. Our <inline-formula id="ieqn-18"><mml:math id="mml-ieqn-18"><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>K</mml:mi><mml:mi>n</mml:mi><mml:mi>o</mml:mi><mml:mi>w</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mi>d</mml:mi><mml:mi>g</mml:mi><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> term, working as intended, was then forced to learn from this ineffective guide, preventing any significant improvement over the already poor baseline.</p>
<p>This finding directly motivates our future work. The supplementary sensitivity analyses on NSL-KDD and UNSW_NB15 provide additional insight into the behavior of the proposed framework beyond a single dataset. On NSL-KDD, appropriate selection of the regularization strength leads to clear improvements in Macro F1 score relative to the baseline. On UNSW_NB15, the proposed method yields more moderate gains, suggesting that the injected knowledge provides partial guidance in settings where baseline representations remain limited. Together, these results demonstrate that the proposed approach remains stable across datasets and that its effectiveness depends on the alignment between the regularization strength, the baseline model, and the underlying data distribution. It suggests a need for a more robust knowledge source, such as an LLM fine-tuned on cybersecurity data, which is not solely dependent on a potentially flawed baseline model&#x2019;s performance on certain classes. Such external knowledge could provide a stronger signal for the <inline-formula id="ieqn-19"><mml:math id="mml-ieqn-19"><mml:msub><mml:mi>L</mml:mi><mml:mrow><mml:mi>K</mml:mi><mml:mi>n</mml:mi><mml:mi>o</mml:mi><mml:mi>w</mml:mi><mml:mi>l</mml:mi><mml:mi>e</mml:mi><mml:mi>d</mml:mi><mml:mi>g</mml:mi><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math></inline-formula> term, especially for classes where the baseline (and thus SHAP) struggles.</p>
<p>The next section summarizes the main findings of this study and outlines directions for future work.</p>
</sec>
<sec id="s6">
<label>6</label>
<title>Conclusion and Future Work</title>
<p>This paper addresses a key limitation in modern Network Intrusion Detection Systems (NIDS), the reliance on static optimization strategies that can lead to misleadingly high performance on imbalanced datasets. To mitigate this issue, we introduced a Domain knowledge-guided Attentional Training framework that integrates SHAP-derived knowledge with a custom gradient regularization loss function. This design reduces reliance on globally dominant but class-irrelevant features and encourages the model to focus on class-specific, informative patterns relevant to each attack type.</p>
<p>Experimental results demonstrate the effectiveness of the proposed framework, yielding a 13.8 percentage-point improvement in the Macro F1 score and achieving reliable detection of rare attacks such as Heartbleed, while maintaining competitive overall accuracy and F1 scores compared to state-of-the-art methods. These findings suggest that incorporating class-specific knowledge into the training process can improve robustness and generalization in highly imbalanced intrusion detection scenarios.</p>
<p>For future work, this framework could be extended to other security domains characterized by severe class imbalance, such as malware analysis. In addition, exploring alternative sources of domain knowledge represents a promising direction. In particular, Large Language Models (LLMs), potentially fine-tuned on specialized cybersecurity reports, could serve as a complementary, non-empirical source of expert knowledge to guide learning, helping to address the limitations of SHAP in extremely low-sample settings.</p>
</sec>
</body>
<back>
<ack>
<p>The authors would like to express their deepest gratitude to their academic supervisors, Prof. Dr. Nahla Belal and Dr. Mohamed Seifeldin, for their invaluable guidance, expertise, and unwavering support throughout this research.</p>
</ack>
<sec>
<title>Funding Statement</title>
<p>The authors received no specific funding for this study.</p>
</sec>
<sec>
<title>Author Contributions</title>
<p>Zakaria S. M. Abdelhalim conceived and designed the study; developed the methodology; implemented the proposed models; performed data preprocessing, experiments, and analysis; and wrote the original draft of the manuscript. Nahla Belal provided academic supervision, methodological guidance, and critical review of the manuscript. Mohamed Seifeldin provided academic supervision, methodological guidance, and critical review of the manuscript. All authors reviewed and approved the final version of the manuscript.</p>
</sec>
<sec sec-type="data-availability">
<title>Availability of Data and Materials</title>
<p>The dataset used in this study is the publicly available <bold>CIC-IDS-2017</bold> dataset, which can be obtained from the Canadian Institute for Cybersecurity. No new data were generated during this study.</p>
</sec>
<sec>
<title>Ethics Approval</title>
<p>This study does not involve human participants, animals, or personal data, and therefore does not require ethical approval.</p>
</sec>
<sec sec-type="COI-statement">
<title>Conflicts of Interest</title>
<p>The authors declare no conflicts of interest.</p>
</sec>
<ref-list content-type="authoryear">
<title>References</title>
<ref id="ref-1"><label>[1]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Sajid</surname> <given-names>M</given-names></string-name>, <string-name><surname>Malik</surname> <given-names>KR</given-names></string-name>, <string-name><surname>Almogren</surname> <given-names>A</given-names></string-name>, <string-name><surname>Malik</surname> <given-names>TS</given-names></string-name>, <string-name><surname>Khan</surname> <given-names>AH</given-names></string-name>, <string-name><surname>Tanveer</surname> <given-names>J</given-names></string-name>, <etal>et al</etal></person-group>. <article-title>Enhancing intrusion detection: a hybrid machine and deep learning approach</article-title>. <source>J Cloud Comput</source>. <year>2024</year>;<volume>13</volume>(<issue>1</issue>):<fpage>123</fpage>. doi:<pub-id pub-id-type="doi">10.1186/s13677-024-00685-x</pub-id>.</mixed-citation></ref>
<ref id="ref-2"><label>[2]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Bella</surname> <given-names>K</given-names></string-name>, <string-name><surname>Guezzaz</surname> <given-names>A</given-names></string-name>, <string-name><surname>Benkirane</surname> <given-names>S</given-names></string-name>, <string-name><surname>Azrour</surname> <given-names>M</given-names></string-name>, <string-name><surname>Fouad</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Benyeogor</surname> <given-names>MS</given-names></string-name>, <etal>et al.</etal></person-group> <article-title>An efficient intrusion detection system for IoT security using CNN decision forest</article-title>. <source>PeerJ Comput Sci</source>. <year>2024</year>;<volume>10</volume>:<fpage>e2290</fpage>. doi:<pub-id pub-id-type="doi">10.7717/peerj-cs.2290</pub-id>; <pub-id pub-id-type="pmid">39314707</pub-id></mixed-citation></ref>
<ref id="ref-3"><label>[3]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Ali</surname> <given-names>ML</given-names></string-name>, <string-name><surname>Thakur</surname> <given-names>K</given-names></string-name>, <string-name><surname>Schmeelk</surname> <given-names>S</given-names></string-name>, <string-name><surname>Debello</surname> <given-names>J</given-names></string-name>, <string-name><surname>Dragos</surname> <given-names>D</given-names></string-name></person-group>. <article-title>Deep learning vs. machine learning for intrusion detection in computer networks: a comparative study</article-title>. <source>Appl Sci</source>. <year>2025</year>;<volume>15</volume>(<issue>4</issue>):<fpage>1903</fpage>. doi:<pub-id pub-id-type="doi">10.3390/app15041903</pub-id>.</mixed-citation></ref>
<ref id="ref-4"><label>[4]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Ahmed</surname> <given-names>U</given-names></string-name>, <string-name><surname>Zheng</surname> <given-names>J</given-names></string-name>, <string-name><surname>Almogren</surname> <given-names>A</given-names></string-name>, <string-name><surname>Khan</surname> <given-names>S</given-names></string-name>, <string-name><surname>Sadiq</surname> <given-names>MT</given-names></string-name>, <string-name><surname>Altameem</surname> <given-names>A</given-names></string-name>, <etal>et al</etal></person-group>. <article-title>Explainable AI-based innovative hybrid ensemble model for intrusion detection</article-title>. <source>J Cloud Comp</source>. <year>2024</year>;<volume>13</volume>(<issue>1</issue>):<fpage>150</fpage>. doi:<pub-id pub-id-type="doi">10.1186/s13677-024-00712-x</pub-id>.</mixed-citation></ref>
<ref id="ref-5"><label>[5]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Abdou Vadhil</surname> <given-names>F</given-names></string-name>, <string-name><surname>Lemine Salihi</surname> <given-names>M</given-names></string-name>, <string-name><surname>Farouk Nanne</surname> <given-names>M</given-names></string-name></person-group>. <article-title>Machine learning-based intrusion detection system for detecting web attacks</article-title>. <source>IAES Int J Artif Intell</source>. <year>2024</year>;<volume>13</volume>(<issue>1</issue>):<fpage>711</fpage>. doi:<pub-id pub-id-type="doi">10.11591/ijai.v13.i1.pp711-721</pub-id>.</mixed-citation></ref>
<ref id="ref-6"><label>[6]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Bouayad</surname> <given-names>A</given-names></string-name>, <string-name><surname>Alami</surname> <given-names>H</given-names></string-name>, <string-name><surname>Janati Idrissi</surname> <given-names>M</given-names></string-name>, <string-name><surname>Berrada</surname> <given-names>I</given-names></string-name></person-group>. <article-title>Lightweight federated learning for efficient network intrusion detection</article-title>. <source>IEEE Access</source>. <year>2024</year>;<volume>12</volume>:<fpage>172027</fpage>&#x2013;<lpage>45</lpage>. doi:<pub-id pub-id-type="doi">10.1109/ACCESS.2024.3494057</pub-id>.</mixed-citation></ref>
<ref id="ref-7"><label>[7]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Almuhanna</surname> <given-names>R</given-names></string-name>, <string-name><surname>Dardouri</surname> <given-names>S</given-names></string-name></person-group>. <article-title>A deep learning/machine learning approach for anomaly based network intrusion detection</article-title>. <source>Front Artif Intell</source>. <year>2025</year>;<volume>8</volume>:<fpage>1625891</fpage>. doi:<pub-id pub-id-type="doi">10.3389/frai.2025.1625891</pub-id>; <pub-id pub-id-type="pmid">40995028</pub-id></mixed-citation></ref>
<ref id="ref-8"><label>[8]</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Bandarupalli</surname> <given-names>G</given-names></string-name></person-group>. <article-title>Efficient deep neural network for intrusion detection using CIC-IDS-2017 dataset</article-title>. In: <conf-name>2025 First International Conference on Advances in Computer Science, Electrical, Electronics, and Communication Technologies (CE2CT); 2025 Feb 21&#x2013;22</conf-name>; <publisher-loc>Nainital, India</publisher-loc>. p. <fpage>476</fpage>&#x2013;<lpage>80</lpage>. doi:<pub-id pub-id-type="doi">10.1109/CE2CT64011.2025.10940012</pub-id>.</mixed-citation></ref>
<ref id="ref-9"><label>[9]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Soumik</surname> <given-names>MS</given-names></string-name></person-group>. <article-title>A comparative analysis of Network Intrusion Detection (NID) using Artificial Intelligence techniques for increase network security</article-title>. <source>Int J Sci Res Arch</source>. <year>2024</year>;<volume>13</volume>(<issue>2</issue>):<fpage>4014</fpage>&#x2013;<lpage>25</lpage>. doi:<pub-id pub-id-type="doi">10.30574/ijsra.2024.13.2.2664</pub-id>.</mixed-citation></ref>
<ref id="ref-10"><label>[10]</label><mixed-citation publication-type="book"><person-group person-group-type="author"><string-name><surname>Saidane</surname> <given-names>S</given-names></string-name>, <string-name><surname>Telch</surname> <given-names>F</given-names></string-name>, <string-name><surname>Shahin</surname> <given-names>K</given-names></string-name>, <string-name><surname>Granelli</surname> <given-names>F</given-names></string-name></person-group>. <chapter-title>Optimizing intrusion detection system performance through synergistic hyperparameter tuning and advanced data processing</chapter-title>. In: <source>Computer science, engineering and information technology</source>. <publisher-loc>Chennai, India</publisher-loc>: <publisher-name>Academy &#x0026; Industry Research Collaboration Center</publisher-name>; <year>2024</year>. p. <fpage>141</fpage>&#x2013;<lpage>60</lpage>. doi:<pub-id pub-id-type="doi">10.5121/csit.2024.141411</pub-id>.</mixed-citation></ref>
<ref id="ref-11"><label>[11]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Sharma</surname> <given-names>V</given-names></string-name></person-group>. <article-title>Improving intrusion detection with hybrid deep learning models: a study on CIC-IDS2017,UNSW-NB15, and KDD CUP 99</article-title>. <source>J Inf Syst Eng Manag</source>. <year>2025</year>;<volume>10</volume>(<issue>11s</issue>):<fpage>633</fpage>&#x2013;<lpage>50</lpage>. doi:<pub-id pub-id-type="doi">10.52783/jisem.v10i11s.1665</pub-id>.</mixed-citation></ref>
<ref id="ref-12"><label>[12]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Li</surname> <given-names>L</given-names></string-name>, <string-name><surname>Lu</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Yang</surname> <given-names>G</given-names></string-name>, <string-name><surname>Yan</surname> <given-names>X</given-names></string-name></person-group>. <article-title>End-to-end network intrusion detection based on contrastive learning</article-title>. <source>Sensors</source>. <year>2024</year>;<volume>24</volume>(<issue>7</issue>):<fpage>2122</fpage>. doi:<pub-id pub-id-type="doi">10.3390/s24072122</pub-id>; <pub-id pub-id-type="pmid">38610334</pub-id></mixed-citation></ref>
<ref id="ref-13"><label>[13]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Talukder</surname> <given-names>MA</given-names></string-name>, <string-name><surname>Islam</surname> <given-names>MM</given-names></string-name>, <string-name><surname>Uddin</surname> <given-names>MA</given-names></string-name>, <string-name><surname>Hasan</surname> <given-names>KF</given-names></string-name>, <string-name><surname>Sharmin</surname> <given-names>S</given-names></string-name>, <string-name><surname>Alyami</surname> <given-names>SA</given-names></string-name>, <etal>et al</etal></person-group>. <article-title>Machine learning-based network intrusion detection for big and imbalanced data using oversampling, stacking feature embedding and feature extraction</article-title>. <source>J Big Data</source>. <year>2024</year>;<volume>11</volume>(<issue>1</issue>):<fpage>33</fpage>. doi:<pub-id pub-id-type="doi">10.1186/s40537-024-00886-w</pub-id>.</mixed-citation></ref>
<ref id="ref-14"><label>[14]</label><mixed-citation publication-type="conf-proc"><person-group person-group-type="author"><string-name><surname>Mia</surname> <given-names>N</given-names></string-name>, <string-name><surname>Haque Gazi</surname> <given-names>MM</given-names></string-name>, <string-name><surname>Ahmed Nabin</surname> <given-names>J</given-names></string-name>, <string-name><surname>Tamim</surname> <given-names>FS</given-names></string-name>, <string-name><surname>Mohammad</surname> <given-names>S</given-names></string-name>, <string-name><surname>Ul Islam</surname> <given-names>MR</given-names></string-name></person-group>. <article-title>A novel temporal-aware adaptive feature selection strategy for network intrusion detection systems</article-title>. In: <conf-name>2025 Global Conference in Emerging Technology (GINOTECH); 2025 May 9&#x2013;11</conf-name>; <publisher-loc>Pune, India</publisher-loc>. p. <fpage>1</fpage>&#x2013;<lpage>6</lpage>. doi:<pub-id pub-id-type="doi">10.1109/GINOTECH63460.2025.11076711</pub-id>.</mixed-citation></ref>
<ref id="ref-15"><label>[15]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Ghanem</surname> <given-names>M</given-names></string-name>, <string-name><surname>Ghaith</surname> <given-names>AK</given-names></string-name>, <string-name><surname>El-Hajj</surname> <given-names>VG</given-names></string-name>, <string-name><surname>Bhandarkar</surname> <given-names>A</given-names></string-name>, <string-name><surname>de Giorgio</surname> <given-names>A</given-names></string-name>, <string-name><surname>Elmi-Terander</surname> <given-names>A</given-names></string-name>, <etal>et al</etal></person-group>. <article-title>Limitations in evaluating machine learning models for imbalanced binary outcome classification in spine surgery: a systematic review</article-title>. <source>Brain Sci</source>. <year>2023</year>;<volume>13</volume>(<issue>12</issue>):<fpage>1723</fpage>. doi:<pub-id pub-id-type="doi">10.3390/brainsci13121723</pub-id>; <pub-id pub-id-type="pmid">38137171</pub-id></mixed-citation></ref>
<ref id="ref-16"><label>[16]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Albattah</surname> <given-names>W</given-names></string-name>, <string-name><surname>Khan</surname> <given-names>RU</given-names></string-name></person-group>. <article-title>Impact of imbalanced features on large datasets</article-title>. <source>Front Big Data</source>. <year>2025</year>;<volume>8</volume>:<fpage>1455442</fpage>. doi:<pub-id pub-id-type="doi">10.3389/fdata.2025.1455442</pub-id>; <pub-id pub-id-type="pmid">40151465</pub-id></mixed-citation></ref>
<ref id="ref-17"><label>[17]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Altalhan</surname> <given-names>M</given-names></string-name>, <string-name><surname>Algarni</surname> <given-names>A</given-names></string-name>, <string-name><surname>Turki-Hadj Alouane</surname> <given-names>M</given-names></string-name></person-group>. <article-title>Imbalanced data problem in machine learning: a review</article-title>. <source>IEEE Access</source>. <year>2025</year>;<volume>13</volume>(<issue>1</issue>):<fpage>13686</fpage>&#x2013;<lpage>99</lpage>. doi:<pub-id pub-id-type="doi">10.1109/ACCESS.2025.3531662</pub-id>.</mixed-citation></ref>
<ref id="ref-18"><label>[18]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Medvedieva</surname> <given-names>K</given-names></string-name>, <string-name><surname>Tosi</surname> <given-names>T</given-names></string-name>, <string-name><surname>Barbierato</surname> <given-names>E</given-names></string-name>, <string-name><surname>Gatti</surname> <given-names>A</given-names></string-name></person-group>. <article-title>Balancing the scale: data augmentation techniques for improved supervised learning in cyberattack detection</article-title>. <source>Eng</source>. <year>2024</year>;<volume>5</volume>(<issue>3</issue>):<fpage>2170</fpage>&#x2013;<lpage>205</lpage>. doi:<pub-id pub-id-type="doi">10.3390/eng5030114</pub-id>.</mixed-citation></ref>
<ref id="ref-19"><label>[19]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Shanmugam</surname> <given-names>V</given-names></string-name>, <string-name><surname>Razavi-Far</surname> <given-names>R</given-names></string-name>, <string-name><surname>Hallaji</surname> <given-names>E</given-names></string-name></person-group>. <article-title>Addressing class imbalance in intrusion detection: a comprehensive evaluation of machine learning approaches</article-title>. <source>Electronics</source>. <year>2025</year>;<volume>14</volume>(<issue>1</issue>):<fpage>69</fpage>. doi:<pub-id pub-id-type="doi">10.3390/electronics14010069</pub-id>.</mixed-citation></ref>
<ref id="ref-20"><label>[20]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Rao</surname> <given-names>YN</given-names></string-name>, <string-name><surname>Suresh Babu</surname> <given-names>K</given-names></string-name></person-group>. <article-title>An imbalanced generative adversarial network-based approach for network intrusion detection in an imbalanced dataset</article-title>. <source>Sensors</source>. <year>2023</year>;<volume>23</volume>(<issue>1</issue>):<fpage>550</fpage>. doi:<pub-id pub-id-type="doi">10.3390/s23010550</pub-id>; <pub-id pub-id-type="pmid">36617148</pub-id></mixed-citation></ref>
<ref id="ref-21"><label>[21]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Allagi</surname> <given-names>S</given-names></string-name>, <string-name><surname>Pawan</surname> <given-names>T</given-names></string-name>, <string-name><surname>Leong</surname> <given-names>WY</given-names></string-name></person-group>. <article-title>Enhanced intrusion detection using conditional-tabular-generative-adversarial-network-augmented data and a convolutional neural network: a robust approach to addressing imbalanced cybersecurity datasets</article-title>. <source>Mathematics</source>. <year>2025</year>;<volume>13</volume>(<issue>12</issue>):<fpage>1923</fpage>. doi:<pub-id pub-id-type="doi">10.3390/math13121923</pub-id>.</mixed-citation></ref>
<ref id="ref-22"><label>[22]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Chinnasamy</surname> <given-names>R</given-names></string-name>, <string-name><surname>Subramanian</surname> <given-names>M</given-names></string-name>, <string-name><surname>Sengupta</surname> <given-names>N</given-names></string-name></person-group>. <article-title>Empowering intrusion detection systems: a synergistic hybrid approach with optimization and deep learning techniques for network security</article-title>. <source>Int Arab J Inf Technol</source>. <year>2025</year>;<volume>22</volume>(<issue>1</issue>):<fpage>60</fpage>&#x2013;<lpage>76</lpage>. doi:<pub-id pub-id-type="doi">10.34028/iajit/22/1/6</pub-id>.</mixed-citation></ref>
<ref id="ref-23"><label>[23]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Arreche</surname> <given-names>O</given-names></string-name>, <string-name><surname>Guntur</surname> <given-names>T</given-names></string-name>, <string-name><surname>Abdallah</surname> <given-names>M</given-names></string-name></person-group>. <article-title>XAI-IDS: toward proposing an explainable artificial intelligence framework for enhancing network intrusion detection systems</article-title>. <source>Appl Sci</source>. <year>2024</year>;<volume>14</volume>(<issue>10</issue>):<fpage>4170</fpage>. doi:<pub-id pub-id-type="doi">10.3390/app14104170</pub-id>.</mixed-citation></ref>
<ref id="ref-24"><label>[24]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Chen</surname> <given-names>X</given-names></string-name>, <string-name><surname>Liu</surname> <given-names>M</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>Z</given-names></string-name>, <string-name><surname>Wang</surname> <given-names>Y</given-names></string-name></person-group>. <article-title>Explainable deep learning-based feature selection and intrusion detection method on the Internet of Things</article-title>. <source>Sensors</source>. <year>2024</year>;<volume>24</volume>(<issue>16</issue>):<fpage>5223</fpage>. doi:<pub-id pub-id-type="doi">10.3390/s24165223</pub-id>; <pub-id pub-id-type="pmid">39204919</pub-id></mixed-citation></ref>
<ref id="ref-25"><label>[25]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Yang</surname> <given-names>Y</given-names></string-name>, <string-name><surname>Khorshidi</surname> <given-names>HA</given-names></string-name>, <string-name><surname>Aickelin</surname> <given-names>U</given-names></string-name></person-group>. <article-title>A review on over-sampling techniques in classification of multi-class imbalanced datasets: insights for medical problems</article-title>. <source>Front Digit Health</source>. <year>2024</year>;<volume>6</volume>:<fpage>1430245</fpage>. doi:<pub-id pub-id-type="doi">10.3389/fdgth.2024.1430245</pub-id>; <pub-id pub-id-type="pmid">39131184</pub-id></mixed-citation></ref>
<ref id="ref-26"><label>[26]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Lakshya</surname> <given-names>V</given-names></string-name>, <string-name><surname>Sai Sri</surname> <given-names>H</given-names></string-name>, <string-name><surname>Subham</surname> <given-names>J</given-names></string-name>, <string-name><surname>Aju</surname> <given-names>D</given-names></string-name></person-group>. <article-title>Unravelling complexity: investigating the effectiveness of SHAP algorithm for improving explainability in network intrusion system across machine and deep learning models</article-title>. <source>Int J Perform Eng</source>. <year>2024</year>;<volume>20</volume>(<issue>7</issue>):<fpage>421</fpage>. doi:<pub-id pub-id-type="doi">10.23940/ijpe.24.07.p2.421431</pub-id>.</mixed-citation></ref>
<ref id="ref-27"><label>[27]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Gaspar</surname> <given-names>D</given-names></string-name>, <string-name><surname>Silva</surname> <given-names>P</given-names></string-name>, <string-name><surname>Silva</surname> <given-names>C</given-names></string-name></person-group>. <article-title>Explainable AI for intrusion detection systems: LIME and SHAP applicability on multi-layer perceptron</article-title>. <source>IEEE Access</source>. <year>2024</year>;<volume>12</volume>:<fpage>30164</fpage>&#x2013;<lpage>75</lpage>. doi:<pub-id pub-id-type="doi">10.1109/ACCESS.2024.3368377</pub-id>.</mixed-citation></ref>
<ref id="ref-28"><label>[28]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Alkhawaldeh</surname> <given-names>IM</given-names></string-name>, <string-name><surname>Albalkhi</surname> <given-names>I</given-names></string-name>, <string-name><surname>Naswhan</surname> <given-names>AJ</given-names></string-name></person-group>. <article-title>Challenges and limitations of synthetic minority oversampling techniques in machine learning</article-title>. <source>World J Methodol</source>. <year>2023</year>;<volume>13</volume>(<issue>5</issue>):<fpage>373</fpage>&#x2013;<lpage>8</lpage>. doi:<pub-id pub-id-type="doi">10.5662/wjm.v13.i5.373</pub-id>; <pub-id pub-id-type="pmid">38229946</pub-id></mixed-citation></ref>
<ref id="ref-29"><label>[29]</label><mixed-citation publication-type="journal"><person-group person-group-type="author"><string-name><surname>Ali Afraji</surname> <given-names>DMA</given-names></string-name>, <string-name><surname>Lloret</surname> <given-names>J</given-names></string-name>, <string-name><surname>Pe&#x00F1;alver</surname> <given-names>L</given-names></string-name></person-group>. <article-title>An integrated hybrid deep learning framework for intrusion detection in IoT and IIoT networks using CNN-LSTM-GRU architecture</article-title>. <source>Computation</source>. <year>2025</year>;<volume>13</volume>(<issue>9</issue>):<fpage>222</fpage>. doi:<pub-id pub-id-type="doi">10.3390/computation13090222</pub-id>.</mixed-citation></ref>
</ref-list>
</back></article>