betaFeedback

WorksComputer Science

Network Intrusion Detection Adaptability under Spurious Labels: A Noise-Aware Few-Shot Class-Incremental Learning Framework

Abstract

Network Intrusion Detection Systems (NIDSs) must incrementally adapt to emerging attacks, even when only a limited amount of labeled network traffic is available. Consequently, Few-Shot Class-Incremental Learning (FSCIL)-based NIDSs have gained growing attention. However, existing FSCIL-based NIDSs are highly vulnerable to label noise in newly-observed attack classes. To address this limitation, we propose NAFN, a noise-aware FSCIL-based NIDS framework that reduces the impact of mislabeled data during incremental adaptation. NAFN consists of two components: (i) Noise Detection, which identifies and removes mislabeled biflows using noise-detection algorithms, and (ii) Feature Sampling, which estimates class-conditional embeddings from clean biflows, calibrates them with base-class statistics, and resamples synthetic features to recover the original biflow count. The framework follows the Rethink Few-Shot (RFS) teacher-student paradigm with lightweight nearest-neighbor or logistic regression classifiers, and various pretraining & memory selection strategies. Experiments on CSE-CIC-IDS2018, Edge-IIoT, and IoT-NID datasets show that NAFN effectively preserves prior knowledge and maintains strong incremental performance even under 50% label noise, consistently improving new-class F1-scores over non-denoised baselines, up to +52%, while being time-efficient and robust in cross-network and high-noise incremental settings. The implementation is publicly available to foster reproducibility.

Introduction

NETWORK Intrusion Detection Systems (NIDSs) play a critical role in safeguarding network security by monitoring traffic and detecting malicious activities. As intrusion techniques become increasingly sophisticated, NIDSs have evolved from early approaches based on port analysis and deep packet inspection to modern detection methods based on Machine Learning (ML) and Deep Learning (DL) [1]. However, traditional ML & DL-based NIDSs are typically trained on closed-world datasets, containing only known benign and attack traffic. In real-world network environments, however, new attacks continually emerge. Recent threat-intelligence reports confirm this trend, driven by ransomware and AI-enabled malicious campaigns. For instance, in Oct. 2025, organizations worldwide faced an average of 1,938 cyberattacks per week, an increase of 2% over the previous month and 5% compared to Oct. 2024 [2]. Consequently, NIDSs struggle to adapt to this ever-changing threat landscape, resulting in limited effectiveness in real deployments. To address this limitation, recent works have explored Class-Incremental Learning (CIL)-based NIDSs [3, 4] to continually learn new attacks while retaining previously acquired knowledge. Nonetheless, CIL suffers from the scarcity of labeled traffic samples for new attacks, particularly in the case of zero-day attacks. The integration of Few-Shot Learning (FSL) [5, 6] with CIL—i.e. Few-Shot Class-Incremental Learning (FSCIL)—has emerged as a promising research direction for attack-traffic detection. FSCIL-based NIDSs aim to incrementally classify new attacks with only a few labeled traffic samples (viz. few shots) without losing performance on previously learned classes.

Despite promising progress [7, 8, 9], existing FSCIL-based NIDS remain fragile in real-world network environments. Most studies assume that the few available samples from new attacks are accurately labeled, which rarely holds true. Unlike base-class datasets that are carefully collected and labeled in controlled settings, new-class attack samples are often gathered from uncontrolled network environments where labels are generated through heuristic rules, automated scripts, or weak supervision, making them prone to errors. Hence, label noise can severely degrade the performance of FSCIL-based NIDS. Since each new attack class contains only a few labeled traffic samples, every mislabeled instance can severely distort the feature distribution, degrading detection performance and introducing classification bias [10]. In contrast, large-sample learning can tolerate noise as its influence is diluted [11]. Although manual relabeling can mitigate this problem, it is costly and undermines the real-time responsiveness required for intrusion detection. Therefore, label noise remains a major challenge that limits the robustness and practical deployment of FSCIL-based NIDS.

In this paper, we propose NAFN, a Noise-Aware FSCIL-based NIDS framework designed to mitigate label noise and enhance robustness in real-world scenarios. NAFN introduces a Noise-Aware Module, consisting of two components: (i) noise detection and (ii) feature sampling. Specifically, the noise detector removes mislabeled traffic samples from new attacks, while the feature sampler generates calibrated embeddings from the remaining clean data to mitigate the impact of sample loss. Since this component is designed as a modular part of NAFN, it can accommodate different noise detection methods. To determine the most suitable choice, we evaluate several candidates, including Local Outlier Factor, Isolation Forest, Example-Level Curriculum Learning, and Prototype-Margin strategy. Ultimately, we adopt Prototype-Margin as the default option due to its superior stability and accuracy. For feature sampling, the module estimates the feature distribution of clean new-class samples (after noise detection) and generates new embeddings based on this distribution. To alleviate distribution bias under few-shot conditions, inspired by the literature on FSL [12], we further introduce a distribution calibration mechanism that leverages statistics from the base classes to align feature distributions of new and existing classes, thereby improving stability and generalization.

NAFN is trained in two stages. First, a base training phase, and then multiple incremental learning phases. During the base training phase, the model learns from the initial classes. When new attacks appear, NAFN performs incremental learning to quickly adapt. We adopt the Rethinking Few-Shot (RFS) approach [13], tailored to incremental learning [7], as the core mechanism enabling NAFN to adapt to new attacks. RFS employs a teacher–student distillation strategy: at each incremental phase, the model from the previous phase acts as the teacher to guide the student, while a small set of samples from old classes (viz. memory) is retained to prevent forgetting. This design enables rapid adaptation to new attacks while maintaining knowledge stability. To further enhance the representation capability of the base model, we explore several pretraining strategies, including reconstruction-based [5, 14], contrastive [15, 16], and hybrid methods [17]. In addition, we propose Mem+, which integrates various exemplar selection strategies to populate the memory. We consider the following strategies: Herding [18], Rainbow [19], and Random Sampling. To summarize, our main contributions are as follows.

  • We propose NAFN, a Noise-Aware Few-Shot Class-Incremental Learning framework for Network Intrusion Detection Systems (NIDS). It enables continual adaptation to novel attacks with few samples while effectively mitigating catastrophic forgetting, thus fulfilling the core goal of FSCIL-based NIDS. Experiments on three benchmark datasets (CSE-CIC-IDS2018, Edge-IIoT, and IoT-NID) demonstrate that NAFN achieves superior performance in incremental adaptation.

  • We design a pluggable Noise-Aware Module to mitigate the impact of label noise. This module can identify and remove label noise in new attack traffic and generate new feature embeddings to restore the original data size. Under label noise conditions (noise levels ranging from 10% to 50%), experimental results show a significant performance improvement in F1-score for new attacks, up to +52% w.r.t. the baseline without denoising strategies.

  • We perform a comprehensive evaluation of NAFN under both individual and combined challenges of cross-network adaptation and label noise. The results show that NAFN achieves consistent and generalizable performance across heterogeneous network datasets and remains robust under severe noise, with the largest observed pAUC improvements reaching 13% for new attacks and 11% for previously unseen attacks in high-noise settings.

The rest of this paper is organized as follows. § 2 reviews recent works relevant to our study and positions our contribution within the existing literature. § 4 formalizes the problem of label noise on FSCIL-based NIDSs and defines our research questions and objectives. Sec. IV provides an overview of NAFN and details each of its components. § 7 describes the experimental setup, while Sec. VI presents a comprehensive evaluation of NAFN on three recent and public datasets. Finally, Sec. VII ends the paper.

Related Works

Background. In recent years, there has been growing research interest in applying ML, and later DL, as the core of AI-based NIDS [30]. Following this first wave, the research community has shifted its focus to addressing the main limitations of ML & DL [3, 31, 32]. Two challenges are particularly relevant, (i) poor performance against network attacks that were not seen during training [3, 4]; (ii) difficulty of gathering and labeling high-quality and up-to-date datasets, which leads to class imbalance, and, consequently, unsatisfactory results [5, 6]. To mitigate the first issue (i), CIL has emerged as a promising direction. Unlike conventional training, where models are retrained from scratch when new classes appear, CIL seeks to incrementally integrate new knowledge without forgetting. CIL approaches typically rely on strategies such as rehearsal, regularization, or dynamic architectures [33]. FSL has shown potential in dealing with the second issue (ii). FSL focuses on enabling models to generalize from a limited number of labeled samples by leveraging prior knowledge acquired from related tasks. FSL approaches typically rely on metric-learning, prototype-based classification, or meta-learning [34]. Efforts to integrate CIL and FSL—i.e. FSCIL—remain relatively underexplored in current literature [7, 8, 9], despite its practical advantages (e.g., rapid adaptation to new threats). In the computer vision domain, FSCIL has been more extensively investigated [35, 36, 37]. The common goal is to prepare models to recognize new classes by exploiting knowledge from previously learned ones. Existing approaches mainly differ in how they allocate and adapt the representation space. For instance, Tao et al. [35] propose a growing Neural Gas Network that dynamically expands its structure to accommodate new classes. Similarly, Zhou et al. [36] reserve embedding space in advance by assigning multiple virtual prototypes. More recently, Wang et al. [37] observe that new-class samples are often misclassified into semantically similar old classes. They leverage this property by calibrating new class prototypes through weighted combinations of old prototypes. In the field of network intrusion detection, FSCIL still faces critical challenges. Particularly, their reliance on only a few labeled samples for adapting to new traffic classes makes them highly vulnerable to label noise. Such noise may arise unintentionally (e.g., labeling in non-controlled

ReferenceYearFSCIL UsedFSCIL ApproachFSCIL CNNoise-Aware Capability PresentDenoising ApproachStrat.Noise-Aware Capability CNDatasetRawEarlyInput
Wang et al. [20]2021✓MAML + MM✗✗––✗NSL-KDD✗✗Flow-based statistics
Abrishami et al. [21]2022✗–✗✓DT + AL w/ US✗✗IoT-NID✗✗Flow-based statistics
Yuan et al. [22]2023✗–✗✓AE + KM + BAL✗[symbol]Malicious TLS, CIC-IDS2017, CICMalDroid-2020, IoT-23✓✗Per-packet informative fields
Yuan et al. [23]2023✗–✗✓MCRe✗[symbol]Malicious TLS, CIC-IDS2017, CICMalDroid-2020, NSL-KDD, LITNET-2020, UNSW-NB15, IoT-23✗✗Flow-based statistics
Hallaji et al. [24]2023✗–✗✓GAN✗[symbol]UNSW-NB15, NIMS✗✗Flow-based statistics
Du et al. [8]2024✓PN + Mem + PL✗✗––✗CIC-IDS2017, CSE-CIC-IDS2018✓✓Per-packet payload
Wang et al. [25]2024✓MAML + MMD✗✗––✗CIC-IDS2017, CSE-CIC-IDS2018✗✗Flow-based statistics
Hosseini and Shi [26]2024✓FZ + GAT✗✗––✗NSL-KDD✗✗Flow-based statistics
Cao et al. [27]2025✓MAML + Mem✗✗––✗CIC-IDS2017✗✗Flow-based statistics
Cerasuolo et al. [9]2025✓FT, FT + Mem, LwF, EWC, EEIL, LUCIR, iCaRL+, BiC✗✗––✗IoT-23, IoT-NID, TON-IoT, Edge-IIoT✓✓Per-packet informative fields
Meng et al. [28]2025✗–✗✓PM✗[symbol]Malicious TLS, CIC-IDS2017, CSE-CIC-IDS2018, CIC-Darknet2020✗✗Flow-based statistics
Zhan et al. [29]2025✗–✗✓TEO + KM + CC✗[symbol]ISCXVPN2016, CrossPlatform, USTC-TFC2016, Malware2023✓✓Per-packet L2 payload
Di Monda et al. [7]2024✓(MN, PN, MON, FT, FZ, RFS) + Mem✓✗––✗CSE-CIC-IDS2018, IoT-NID✓✓Per-packet informative fields
This work2026✓(RS, CS, HS)++ RFS + Mem+✓✓(LOF, IF, E-CL, PM) + Aug[symbol]✓CSE-CIC-IDS2018, IoT-NID, Edge-IIoT✓✓Per-packet informative fields

Table 1. Related studies focusing on network intrusion detection with FSCIL and noisy labels. Papers are listed in chronological order by publication year. The final row provides an overview of the current work. The meaning of acronyms is provided at the bottom of the table.

Approach—Few-Shot Class-Incremental Learning approach used; Denoising Approach—Denoising approach used; Strat.—Strategy related to the noise-aware capability; CN—Whether the paper performs Cross-Network analyses; Raw—Whether raw input data is used; Early—Whether early traffic classification is used. Acronyms: Active Learning (AL) with Uncertainty Sampling (AL w/ US), Autoencoder (AE), Augmentation (Aug), Bias Correction (BiC), Boundary Augmentation Loss (BAL), Confidence-based Correction (CC), Contrastive Strategy (CS), Decision Tree (DT), Elastic Weight Consolidation (EWC), End-to-End Incremental Learning (EEIL), Example-Level Curriculum Learning (E-CL), Fine-Tuning (FT), Freezing (FZ), Generative Adversarial Network (GAN), Graph Attention Network (GAT), Hybrid Strategy (HS), Incremental Classifier and Representation Learning (iCaRL+), Isolation Forest (IF), K-Means (KM), Learning a Unified Classifier Incrementally via Re-balancing (LUCIR), Matching Without Forgetting (LwF), Local Outlier Factor (LOF), Maximum Mean Discrepancy (MMD), Memory (Mem), MetaOpNet (MON), Model-Agnostic Meta-Learning (MAML), Model Merging (MM), Multidimensional Constraint Representation (MCRe), Matching Networks (MN), Prototype-Margin (PM), Prototypical Networks (PN), Projection Layer (PL), Reconstruction-based Strategy (RS), Rethinking Few-Shot (RFS), Transformer Encoder-Only (TEO). Symbols: ✓ passing; ✗ lacking; [symbol] denoising approach that makes the model more robust to label noise, [symbol] denoising approach that corrects mislabeled samples; “–” indicates that the field is not relevant for that paper.

environments) or through adversarial manipulation (e.g., label-flipping attacks). Although the literature on label noise in non-FSCIL contexts is growing [21, 22], the availability of larger datasets in these contexts partially mitigates its impact, making it less critical than in FSCIL scenarios.

Literature Review

Table I categorizes the most relevant works that employ FSCIL and address the label noise problem. Research on FSCIL is still in its early stages; the first contribution was proposed in 2021 [20], while most subsequent works appeared between 2024 and 2025 [7, 9, 25, 26, 27]. Studies that address label noise in the context of NIDS remain relatively limited, reflecting the novelty of this research effort [21, 22, 23, 24, 28, 29]. Notably, to the best of our knowledge, no existing work has yet tackled label noise within the FSCIL setting.

Among the FSCIL approaches explored in the literature, the most common is Model-Agnostic Meta-Learning (MAML) [38], originally designed for FSL applications. Works adopting MAML [20, 25, 27] extend it with strategies to handle forgetting and add new classes. In particular, Wang et al. [20] enable MAML for FSCIL through a model growth technique. Wang et al. [25] use Maximum Mean Discrepancy (MMD) to alleviate forgetting by selecting models with similar feature distributions. Cao et al. [27] adopt memory

replay of previous classes during the incremental task. Unlike the aforementioned works, Du et al. [8] adapt Prototypical Networks (PN) [39] to FSCIL using memory replay [27] and introduce session-specific projection layers to improve traffic-feature discriminability. Cerasuolo et al. [9] evaluate several CIL approaches from computer vision and traffic classification under few-shot constraints. In our previous work [7], we adapt a set of FSL approaches to FSCIL by integrating memory replay to mitigate forgetting.

Regarding denoising approaches, state-of-the-art works can be grouped into two strategies. The first aims to build models robust to spurious labels. Yuan et al. [22] design both the model architecture and the loss function to enhance robustness. They employ an Autoencoder coupled with a K-Means to cluster samples in unsupervised fashion, thus reducing the impact of noisy annotations. A Boundary Augmentation Loss is then introduced to regularize decision boundaries. Similarly, Zhan et al. [29] use K-Means to detect noisy labels and correct them based on prediction confidence. They use a Transformer encoder-only for noise robustness. Hallaji et al. [24] adopt a generative approach to inject artificial noise, training classifiers on perturbed samples, viz. vaccination.

The second strategy of works focuses on *correcting mislabeled samples. Specifically, Abrishami et al. [21] use Decision Trees to detect potential label errors, assuming minority labels in a leaf are likely incorrect, and leverage Active Learning to have humans verify uncertain cases. Yuan et al. [23] and Meng et al. [28] both leverage local density and feature similarity to identify reliable prototypes for relabeling. In both papers, samples are reassigned based on their similarity to class prototypes. Yuan et al. [23] introduce a custom loss to preserve class separability, while Meng et al. [28] refine prototype selection by choosing high-density yet diverse samples. Table I highlights that the current literature lacks systematic cross-network analyses [31, 40] in FSCIL and label noise scenarios (e.g., models are trained on one dataset, representing a network environment, and tested on another, or incremental classes belong to a different dataset than the one used for pretraining). The only exception [7] performs a cross-network incremental analysis for FSCIL approaches. To the best of our knowledge, no existing work addresses cross-network studies under noisy-label conditions.

Regarding the datasets, we observe that CIC-IDS2017 and CSE-CIC-IDS2018 are among the most popular choices [7, 8, 22, 23, 25, 27, 28]. Several IoT-oriented datasets are also frequently adopted (i.e. IoT-23, IoT-NID, and Edge-IIoT [7, 9, 21, 22]). While NSL-KDD remains popular [20, 23, 26], despite being over two decades old, it no longer reflects modern network traffic and offers limited relevance for evaluating contemporary NIDS.

Table I also flags the studies that employ raw input [7, 8, 9, 22, 29], i.e. unprocessed network data, in contrast to handcrafted or statistical features. Raw input is naturally aligned with DL approaches, which are capable of automatically extracting meaningful representations. On the other hand, works that rely on statistical features introduce additional pre-processing steps, increasing computational overhead. Furthermore, they weaken the “promise” of end-to-end DL pipelines requiring little or no human intervention.

Finally, the table marks the works adopting an early input strategy [7, 8, 9, 29]. This approach leverages only the initial portion of a traffic object (e.g., the first packets or bytes of the payload) as input, enabling early detection. Remaining works, instead, rely on the entire traffic object, making them suitable only for post-mortem detection, which is effective for offline analysis but unsuitable for live network scenarios. Positioning. The last row of Table I positions our work against the reviewed literature. Building on our previous work [7], which compared multiple FSCIL approaches, we explore different training and adaptation optimizations for FSCIL-based NIDS, including improved pre-training stages and memory selection criteria (referred to as Mem+). Unlike the literature leveraging MAML for FSCIL, which is known for its high computational cost and slow adaptation [41], our method builds upon the more efficient RFS [13]. In our prior study [7], RFS delivered the best performance and is better suited for real-world NIDS deployments. Furthermore, it differs from Wang et al. [25], which adopts a model selection strategy requiring the storage of multiple candidate models, thereby limiting scalability. RFS also differs from FSCIL based on PN [8], whose performance strongly depends on the quality of the learned prototypes. Existing works reveals two main gaps concerning label noise: (i) the lack of studies addressing label noise within the FSCIL setting, and (ii) the absence of comparative analyses across denoising strategies. We address both gaps by systematically evaluating and comparing multiple denoising approaches under FSCIL. Moreover, we ground our denoising strategy, based on filtering and synthesizing clean biflows, in the findings of [42]. In real-world NIDS deployments, the true noise ratio is unknown, making over-cleaning a realistic risk. Under these conditions, Jiang et al. [42] show that filtering significantly outperforms correction. The main limitation of filtering is the reduced sample size, which can increase the generalization error bound; our feature sampling module mitigates this effect. This distinguishes our approach from prior works based on label correction [21, 23, 28]. Equally important, we conduct a cross-network incremental study on both FSCIL and label noise scenarios across three recent and publicly-available datasets. All experiments are performed on raw and early input data to ensure realistic and low-latency NIDS.

Problem Formalization & Research Objectives

In this section, we formalize FSCIL and label noise in the context of NIDS. Next, we present the research objectives of our proposed framework, NAFN.

FSCIL Formalization. The goal of a FSCIL-based NIDS is to continuously adapt to new attack classes using only a few labeled samples, while preserving high classification performance on previously learned classes. Formally, the base training phase refers to training the model on the class set Cbase\mathcal{C}_{\mathrm{base}}, which includes benign traffic and a set of known attack classes. Each base class contains an average of Nˉbase\bar{N}_{\mathrm{base}} labeled samples for training, where Nˉbase\bar{N}_{\mathrm{base}} denotes the average number of samples per base class. This phase produces the initial (base) model used for subsequent incremental learning phases. During each incremental phase t∈{1,2,…}t \in\{1,2,\ldots\}, a new set of attack classes Cnew(t)\mathcal{C}_{\mathrm{new}}^{(t)} appears, corresponding to previously unseen attacks:

Cnew(t)∩Cold(t)=∅,where Cold(t)=Cbase∪⋃i=1t−1Cnew(i).(1)\mathcal{C}_{\mathrm{new}}^{(t)} \cap\mathcal{C}_{\mathrm{old}}^{(t)} = \varnothing,\qquad\text{where }\mathcal{C}_{\mathrm{old}}^{(t)} = \mathcal{C}_{\mathrm{base}} \cup\bigcup_{i=1}^{t-1}\mathcal{C}_{\mathrm{new}}^{(i)}. \tag*{(1)}

This condition ensures that each incremental phase involves previously unseen attack classes. Each new class c∈Cnew(t)c \in\mathcal{C}_{\mathrm{new}}^{(t)} contains only a small number of KK labeled samples, where K≪NˉbaseK \ll\bar{N}_{\mathrm{base}}. The primary challenge of FSCIL in the context of NIDS is to achieve rapid adaptation to newly emerging attacks in Cnew(t)\mathcal{C}_{\mathrm{new}}^{(t)} while preserving high classification performance on previously learned classes in Cold(t)\mathcal{C}_{\mathrm{old}}^{(t)}.

Label Noise Formalization. In a real-world FSCIL-based NIDS setting, the limited samples available for new attacks Cnew(t)\mathcal{C}_{\mathrm{new}}^{(t)} are often affected by label noise. Let the attack dataset for incremental phase tt be

Dnew(t)={(xi,y~i)}i=1N(t),(2)\mathcal{D}_{\mathrm{new}}^{(t)} = \{(x_i,\tilde{y}_i)\}_{i=1}^{N^{(t)}}, \tag*{(2)}

with y~i∈Cnew(t)\tilde{y}_i \in\mathcal{C}_{\mathrm{new}}^{(t)} the observed (possibly noisy) label of attack sample xix_i. For clarity, let yiy_i denote the ground-truth label. Since each new class c∈Cnew(t)c \in\mathcal{C}_{\mathrm{new}}^{(t)} contains only KK labeled samples, the total number of samples for the phase is N(t)=K×∣Cnew(t)∣N^{(t)} = K \times\lvert C_{\mathrm{new}}^{(t)}\rvert. Label noise occurs when y~i≠yi\tilde{y}_i \ne y_i, e.g., when a sample from attack class c1c_1 is mislabeled as attack c2c_2. The noise rate η\eta is defined as

η=1N(t)∑i=1N(t)I[y~i≠yi],(3)\eta= \frac{1}{N^{(t)}} \sum_{i=1}^{N^{(t)}} \mathbb{I}[\tilde{y}_i \ne y_i], \tag*{(3)}

where I[⋅]\mathbb{I}[\cdot] is the indicator function. Note that label noise is symmetrically distributed across classes in Cnew(t)C_{\mathrm{new}}^{(t)}. Given the small number of samples for each new attack class, even a small noise rate η\eta can significantly degrade the discriminative power of the model. Thus, the central challenge addressed in this paper lies in achieving stable incremental learning under the dual constraints of few-shot data and label noise.

Research Questions & Objectives. Building upon the identified challenges, this work formulates the following research questions and their corresponding objectives, centered around the proposed Noise-Aware FSCIL-based NIDS (NAFN).

Q1 Can NAFN address the primary challenge of FSCIL by effectively adapting to new attack classes while retaining previously acquired knowledge?

Image not extracted

Figure 10.

Objective. To design and evaluate NAFN for effective adaptation to novel attack classes from few labeled biflows, while retaining prior knowledge, as examined in Secs. VI-A, VI-B, and VI-C.

Q2 How robust is NAFN to label noise, and how effective are its integrated noise detection and feature calibration mechanisms in mitigating the impact of mislabeled samples?

Objective. To enhance robustness to mislabeled samples via noise detection and feature calibration, preserving stable, discriminative features under noisy few-shot conditions (Secs. VI-D, VI-E, and VI-F).

Q3 Can NAFN maintain stable and generalizable performance when adapting across different networks, and remain robust when facing the combined challenges of cross-network adaptation and label noise?

Objective. To assess NAFN’s generalization and stability across datasets, including cross-network adaptation and robustness under combined label noise and domain shift (Sec. VI-G).

Methodology

In this section, we present the overall methodology of NAFN, as illustrated in Figure 1. Particularly, we describe NAFN from three complementary perspectives:

Figure 1. Overview of the NAFN framework. It consists of three main perspectives: (i) NIDS Workflow (horizontal process): from flow processing and feature encoding to the attack-traffic classifier; (ii) Learning Procedure (vertical process): including base training and incremental learning phases with Mem+-based memory selection; (iii) Noise-Aware Module: operating during the incremental learning phase. It detects mislabeled traffic samples and synthesizes feature embeddings.

  1. NIDS Workflow (Horizontal Process). The end-to-end data pipeline—composed of Flow Processor, Feature Encoder, and Attack-Traffic Classifier—transforms raw network traffic into feature embeddings and labels traffic in benign and attack classes (Sec. IV-A).

  2. Learning Procedure (Vertical Process). Describes how NAFN learns across tasks via Base Training and Incremental Learning phases, following the teacher–student paradigm. The Memory Update mechanism (Mem+) preserves representative samples to reduce catastrophic forgetting (Sec. IV-B).

  3. Noise-Aware Module. In addition to these two main processes, NAFN includes the Noise-Aware Module that operates exclusively during the incremental learning phase. It detects mislabeled samples of new attacks and synthesizes calibrated embeddings to maintain clean training data (Sec. IV-C).

By integrating these perspectives—the horizontal workflow, the vertical learning procedure, and the Noise-Aware Module—NAFN achieves robust and continual adaptation to emerging attacks under a noisy few-shot regime.

NIDS Workflow

The NIDS Workflow in Figure 1 outlines the end-to-end process through which raw network traffic is transformed into discriminative feature representations for attack detection. It consists of three sequential modules—Flow Processor, Feature Encoder, and Attack-Traffic Classifier—described below.

Flow Processor. This module transforms raw network traffic into structured traffic data, which then serves as input to the Feature Encoder. The transformation occurs through two main steps: (i) Biflow Splitting and (ii) Input Extraction. In the first step, raw network traffic is organized into bidirectional flows (i.e. biflows). A biflow is formed by merging two unidirectional flows that share the same five-tuple (i.e. source IP, destination IP, source port, destination port, protocol) but travel in opposite directions. This aggregation provides a unified representation of bidirectional communication and avoids redundant flow entries [7, 8, 9, 29]. In the second step, only the first MpM_p packets of each biflow are retained. This approach enables early detection (§ 2). By doing so, the NIDS can operate without waiting for the entire biflow to end, making it well-suited for real-time detection [7, 8, 9, 29]. From the MpM_p packets, MfM_f per-packet features (e.g., packet length and direction) are extracted to form the structured representation. Each biflow is thus represented as an Mp×MfM_p \times M_f feature matrix xx. If fewer than MpM_p packets are available, zero-padding is applied to ensure x∈RMp×Mfx \in\mathbb{R}^{M_p \times M_f}, and the resulting matrix is normalized to [0,1][0,1] using Min–Max scaling.

Feature Encoder. The Feature Encoder maps each biflow matrix x∈RMp×Mfx \in\mathbb{R}^{M_p \times M_f} into a FF-dimensional feature embedding e=fθ(x)∈RFe = f_\theta(x) \in\mathbb{R}^{F}, where fθf_\theta denotes the encoder parameterized by θ\theta. It serves as the backbone representation extractor of NAFN. Structurally, the encoder follows a symmetric U-Net–based architecture enhanced with residual connections [43]. The feature encoder consists of LL downsampling stages and the corresponding LL upsampling stages. Each downsampling stage LiL_i is constructed using a Residual Convolution Block (RCB) comprising two 2D convolutional layers, batch normalization, and LeakyReLU activations, with an identity skip path to stabilize gradient propagation. In the downsampling path, the input xx is first reshaped to [1,Mp,Mf][1,M_p,M_f] to match the 2D convolutional format, and processed by an initial RCB to yield a feature map of size [Ch0,Mp,Mf][Ch_0,M_p,M_f]. The feature map is passed through LL downsampling stages. Each stage progressively reduces the spatial resolution by pooling while doubling the number of feature channels. The output of the ii-th downsampling stage (i∈[1,L]i \in[1,L]) has the shape [Chi,Mp//2i,Mf//2i][Ch_i,M_p//2^i,M_f//2^i], where //// denotes floor division, i.e., Mp//2i=⌊Mp/2i⌋M_p//2^i = \lfloor M_p/2^i \rfloor. The resulting tensor is flattened and linearly projected to a fixed-length latent vector e∈RFe \in\mathbb{R}^{F}, which compactly encodes both local packet-level and global flow-level patterns. In the upsampling path, each stage performs transposed convolution to restore the spatial resolution. Upsampled feature maps are concatenated with the corresponding outputs from the downsampling stages through skip connections, restoring finer details. Symmetrically, the output of the ii-th upsampling stage has the shape [ChL−i,Mp//2L−i,Mf//2L−i][Ch_{L-i},M_p//2^{L-i},M_f//2^{L-i}]. Finally, a 1×11 \times1 convolution layer produces the reconstructed feature map of size [1,Mp,Mf][1,M_p,M_f], which is used as auxiliary outputs for the reconstruction-based strategy in the base training phase.

Attack-Traffic Classification. The Attack-Traffic Classifier is a decision-making component that operates on the feature embeddings generated by the encoder (e∈RFe \in\mathbb{R}^{F}). Its objective is to classify benign traffic and multiple attack classes (viz. multi-class misuse detection [44]). Formally, in a generic incremental phase tt, we train the classifier using the embedded biflows from both the previously learned classes Cold(t)\mathcal{C}_{\mathrm{old}}^{(t)} and new ones Cnew(t)\mathcal{C}_{\mathrm{new}}^{(t)}, where each class provides only KK labeled biflows. The classifier takes the embedding vector ee as input and outputs a probability vector y^\hat{\mathbf{y}} over all observed classes Call(t)=Cold(t)∪Cnew(t)\mathcal{C}_{\mathrm{all}}^{(t)} = \mathcal{C}_{\mathrm{old}}^{(t)} \cup\mathcal{C}_{\mathrm{new}}^{(t)}. This mapping can be formally expressed as fcls:RF→R∣Call(t)∣f_{\mathrm{cls}}:\mathbb{R}^{F}\to\mathbb{R}^{|\mathcal{C}_{\mathrm{all}}^{(t)}|}, where ∣Call(t)∣|\mathcal{C}_{\mathrm{all}}^{(t)}| denotes the total number of classes. For NAFN, we consider two possible lightweight classifiers, each offering complementary advantages in terms of stability and adaptability. (i) The Nearest-Neighbor (NN) classifier assigns each embedding to the class of its closest sample in the learned feature space. Here, we use a soft NN rule, computing class posterior probabilities via a distance-based softmax over the nearest biflow from each class. This non-parametric approach relies on similarity measures and requires no trainable parameters, ensuring stability and low computational cost. (ii) The Logistic Regression (LR) classifier is a parametric linear model that learns decision boundaries by optimizing a cross-entropy objective. It provides greater discriminative power and flexibility, especially when sufficient labeled biflows are available. These two classifiers can be selected depending on the task configuration and the desired trade-off between stability and plasticity.

Learning Procedure

Figure 1 illustrates the learning procedure of NAFN, describing how the NIDS learns and adapts across sequential phases. In particular, we consider two phases, i.e. Base Training Phase and Incremental Learning Phase, outlined hereinafter.

Base Training Phase. The goal of the base training phase is to construct an effective feature encoder on the base dataset, which consists of known attack classes and benign traffic classes (denoted as Cbase\mathcal{C}_{\mathrm{base}}) with ample samples, to learn robust and transferable feature representations from network traffic. Once trained, this feature encoder serves as a teacher model that provides guidance for subsequent incremental phases. To ensure that the encoder learns discriminative and generalizable feature embeddings on Cbase\mathcal{C}_{\mathrm{base}}, we jointly utilize supervised and self-supervised learning objectives and design three pretraining strategies (see Figure 2):

Figure 2. Overview of the three pretraining strategies.

  • Reconstruction-based Strategy. According to this strategy, the feature extractor is mirrored to form a decoder gϕ(⋅)g_\phi(\cdot) that reconstructs the input tensor xx from the embedding vector e=fθ(x)e = f_\theta(x). It corresponds to the upsampling path of the U-Net architecture (see Sec. IV-A), where transposed convolutions and skip connections are employed to reconstruct the spatial-temporal structure of a biflow. In addition, a temporary classification head hψ(⋅)h_\psi(\cdot) outputs attack-traffic prediction using the embedding ee. The model is optimized by jointly minimizing the reconstruction loss ❶ and the classification loss (i.e. cross-entropy loss) ❷ (see Figure 2):

Lrecon=∥x−x^∥22,LCE=−∑yelog⁡(hψ(e))\mathcal{L}_{\mathrm{recon}} = \lVert x - \hat{x} \rVert_2^2,\qquad\mathcal{L}_{\mathrm{CE}} = -\sum y_e \log(h_\psi(e))
LTotal=α⋅Lrecon+(1−α)⋅LCE(4)\mathcal{L}_{\mathrm{Total}} = \alpha\cdot\mathcal{L}_{\mathrm{recon}} + (1-\alpha)\cdot\mathcal{L}_{\mathrm{CE}} \tag*{(4)}

where x^=gϕ(fθ(x))\hat{x}=g_{\phi}(f_{\theta}(x)) is the reconstructed input, ycy_c represents the true label for class cc, and α\alpha is a balancing coefficient.

  • Contrastive Strategy. The following strategy introduces a contrastive learning objective to encourage invariant and generalizable representations. Specifically, we adopt the Momentum Contrast (MoCo) [15], where eqe_q denotes the query embedding produced by the encoder, epe_p is the positive embedding obtained from the momentum encoder (an augmented view of the same biflow), and {en(i)}i=1Nneg\{e_n^{(i)}\}_{i=1}^{N_{\mathrm{neg}}} are negative embeddings stored in a dynamic memory queue. The contrastive loss is formulated as:

LContrast=−log⁡exp⁡(eq⋅ep/τ)exp⁡(eq⋅ep/τ)+∑i=1Nnegexp⁡(eq⋅en(i)/τ)(5)\mathcal{L}_{\mathrm{Contrast}}=-\log\frac{\exp(e_q\cdot e_p/\tau)}{\exp(e_q\cdot e_p/\tau)+\sum_{i=1}^{N_{\mathrm{neg}}}\exp(e_q\cdot e_n^{(i)}/\tau)} \tag*{(5)}

where τ>0\tau>0 is a temperature parameter controlling the softness of the probability distribution and eq⋅epe_q\cdot e_p denotes the inner product between two embedding vectors. We generate positive samples via a biflow-specific augmentation, called permutation, in which the original biflow is divided into nn segments and randomly reordered, simulating variations in packet sequencing [45]. The overall loss combines the contrastive and classification losses:

LTotal=β⋅LContrast+(1−β)⋅LCE,(6)\mathcal{L}_{\mathrm{Total}}=\beta\cdot\mathcal{L}_{\mathrm{Contrast}}+(1-\beta)\cdot\mathcal{L}_{\mathrm{CE}}, \tag*{(6)}

where β\beta is a balancing coefficient. This strategy enhances the invariance and generalization capability of the learned embeddings by contrasting positive and negative pairs across dynamic batches.

  • Hybrid Strategy. This strategy combines the reconstruction and contrastive losses with the classification loss to fully exploit complementary supervision from multiple objectives, thereby improving the discriminability and robustness of the feature encoder. The overall loss function is formulated as:

LTotal=α⋅LRecon+β⋅LContrast+(1−α−β)⋅LCE.(7)\mathcal{L}_{\mathrm{Total}}=\alpha\cdot\mathcal{L}_{\mathrm{Recon}}+\beta\cdot\mathcal{L}_{\mathrm{Contrast}}+(1-\alpha-\beta)\cdot\mathcal{L}_{\mathrm{CE}}. \tag*{(7)}

Incremental Learning Phase

At each incremental phase tt, we adopt the RFS approach [13], using the feature extractor from the previous (t−1)th(t-1)^{\mathrm{th}} phase as a teacher model to distill knowledge into the new student feature extractor fθ(t)f_{\theta^{(t)}}. In this phase, training relies exclusively on the biflows of previously learned classes stored in the memory, with the goal of preserving the stability of their feature representations. Formally, given the teacher model fθ(t−1)f_{\theta^{(t-1)}} from the previous phase (t−1)(t-1), we update the student fθ(t)f_{\theta^{(t)}} using only the classes Cold(t)\mathcal{C}_{\mathrm{old}}^{(t)} from phase (t−1)(t-1). Let Dold(t)\mathcal{D}_{\mathrm{old}}^{(t)} denote the training set containing Cold(t)\mathcal{C}_{\mathrm{old}}^{(t)} biflows selected by Mem+ from the memory bank, the student is optimized by a weighted sum of the classification and KL distillation objectives:

θ(t)=arg⁡min⁡θ(t) E(x,y)∼Dold(t)[λ1⋅LCE(hψ(t)(fθ(t)(x)),y)+λ2⋅LKL(hψ(t)(fθ(t)(x)),hψ(t−1)(fθ(t−1)(x)))].(8)\theta^{(t)}=\underset{\theta^{(t)}}{\arg\min}\ \mathbb{E}_{(x,y)\sim\mathcal{D}_{\mathrm{old}}^{(t)}}\left[\lambda_1\cdot\mathcal{L}_{\mathrm{CE}}\left(h_{\psi^{(t)}}\left(f_{\theta^{(t)}}(x)\right),y\right)+\lambda_2\cdot\mathcal{L}_{\mathrm{KL}}\left(h_{\psi^{(t)}}\left(f_{\theta^{(t)}}(x)\right),h_{\psi^{(t-1)}}\left(f_{\theta^{(t-1)}}(x)\right)\right)\right]. \tag*{(8)}

After convergence, during the ttht^{\mathrm{th}} phase, we freeze the feature extractor fθ(t)f_{\theta^{(t)}} of the student to avoid catastrophic forgetting. The frozen model is then used to extract biflow embeddings e\mathbf{e} for the attack-traffic classifier (see Sec. IV-A). Finally, the updated student parameters θ(t)\theta^{(t)} replace the previous teacher for the next incremental phase (t+1)(t+1).

Memory Update (Mem+). After each incremental phase, the exemplar memory is updated to retain the most representative biflows for all learned classes. We denote the proposed enhanced exemplar selection as Mem+. For each class, we compute feature embeddings using the current model and select the KK most representative samples. Mem+ supports multiple strategies: Herding [18], Rainbow [19], and random sampling. The memory size is bounded by a fixed budget, ensuring balanced representation across old and new classes. The updated memory bank is then used for the incoming incremental phase to support student training.

Noise-Aware Module

The Noise-Aware Module is the core component of our NAFN framework. It operates only during the incremental learning phase to handle potential spurious labels in newly introduced attack classes, improving robustness in the FSCIL-NIDS setting. It consists of two key components: (i) a Noise Detection Module, which detects and removes mislabeled samples, and (ii) a Feature Sampling Module, which synthesizes additional clean feature embeddings to maintain the original data scale and class balance.

Noise Detection Module. During the ttht^{\mathrm{th}} incremental learning phase, for each new attack class c∈Cnew(t)c \in\mathcal{C}_{\mathrm{new}}^{(t)} with feature embeddings Ec={e1,…,eK}\mathcal{E}_c = \{\mathbf{e}_1,\ldots,\mathbf{e}_K\}, we obtain a denoised subset E^c⊂Ec\widehat{\mathcal{E}}_c \subset\mathcal{E}_c by filtering out suspected mislabeled items using a denoising strategy. We remove the top κ=⌊ρK⌋\kappa= \lfloor\rho K \rfloor anomaly samples, where ρ∈[0,1]\rho\in[0,1] is a hyperparameter that controls the denoising ratio (i.e. the proportion of samples regarded as noisy). To achieve this goal, we explore four noise detection approaches, each designed to identify noisy samples from different statistical or representation-based perspectives.

i)i) Local Outlier Factor (LOF) evaluates the local density deviation of a biflow relative to its neighbors:

LOF⁡r(ei)=1∣Nr(ei)∣∑ej∈Nr(ei)lrd⁡r(ej)lrd⁡r(ei).(9)\operatorname{LOF}_r(\mathbf{e}_i) = \frac{1}{|\mathcal{N}_r(\mathbf{e}_i)|} \sum_{\mathbf{e}_j \in\mathcal{N}_r(\mathbf{e}_i)} \frac{\operatorname{lrd}_r(\mathbf{e}_j)}{\operatorname{lrd}_r(\mathbf{e}_i)} . \tag*{(9)}

Here, Nr(ei)\mathcal{N}_r(\mathbf{e}_i) denotes the rr-nearest neighbors of ei\mathbf{e}_i, where rr controls the neighborhood size, and lrd⁡r(⋅)\operatorname{lrd}_r(\cdot) is the local reachability density.

ii)ii) Isolation Forest (IF) measures the expected isolation path length of each biflow:

s(ei)=2−E[L(ei)]ζ(K),(10)s(\mathbf{e}_i) = 2^{-\frac{\mathbb{E}[L(\mathbf{e}_i)]}{\zeta(K)}} , \tag*{(10)}

where E[L(ei)]\mathbb{E}[L(\mathbf{e}_i)] is the expected path length of ei\mathbf{e}_i in the isolation trees, and ζ(K)\zeta(K) is a normalization factor depending on the sample size KK.

iii)iii) Prototype-Margin (ProtoMargin) iteratively refines the class prototype and measures each biflow’s similarity margin between intra- and inter-class prototypes. The prototype is updated as:

pc(0)=1K∑i=1Kei,(11)\mathbf{p}_c^{(0)} = \frac{1}{K} \sum_{i=1}^{K} \mathbf{e}_i, \tag*{(11)}
pc(t+1)=mean⁡(Top-⁡r{ei∣sim⁡(ei,pc(t))}),(12)\mathbf{p}_c^{(t+1)} = \operatorname{mean}\left(\operatorname{Top-}r\{\mathbf{e}_i \mid\operatorname{sim}(\mathbf{e}_i,\mathbf{p}_c^{(t)})\}\right), \tag*{(12)}

where r=(1−ρ)Kr = (1-\rho)K, and sim⁡(⋅,⋅)\operatorname{sim}(\cdot,\cdot) denotes the similarity function (e.g., cosine similarity). After II iterations, the score of each biflow is computed as:

s(ei)=sim⁡(ei,pc)−max⁡c′≠csim⁡(ei,pc′).(13)s(\mathbf{e}_i) = \operatorname{sim}(\mathbf{e}_i,\mathbf{p}_c) - \max_{c' \ne c} \operatorname{sim}(\mathbf{e}_i,\mathbf{p}_{c'}). \tag*{(13)}

The top (1−ρ)K(1-\rho)K biflows with the highest scores are retained as clean samples.

iv)iv) Example-Level Curriculum Learning (E-CL) trains a temporary classifier fϕf_\phi for a few epochs across all observed classes Call(t)\mathcal{C}_{\mathrm{all}}^{(t)} [46]. The cross-entropy loss for a biflow ei\mathbf{e}_i with label y~i\widetilde{y}_i is:

ℓi=−log⁡exp⁡(fϕ(ei)[y~i])∑j=1∣Call(t)∣exp⁡(fϕ(ei)[j]).(14)\ell_i = -\log\frac{\exp(f_\phi(\mathbf{e}_i)[\widetilde{y}_i])}{\sum_{j=1}^{|\mathcal{C}_{\mathrm{all}}^{(t)}|} \exp(f_\phi(\mathbf{e}_i)[j])}. \tag*{(14)}

Here, exp⁡(fϕ(ei)[y~i])\exp(f_\phi(\mathbf{e}_i)[\widetilde{y}_i]) represents the probability score of sample ei\mathbf{e}_i on its observed label y~i\widetilde{y}_i in the classifier output. The biflows with the highest ℓi\ell_i values are regarded as noisy and removed from the training set.

Feature Sampling Module. Since denoising reduces the number of training biflows, the Feature Sampling Module

compensates for this loss by synthesizing new and clean feature embeddings. For each new attack class cc, it estimates and calibrates a Gaussian distribution from the denoised subset E^c\widehat{\mathcal{E}}_c:

μc=1∣E^c∣∑e∈E^ce,Σc=Cov⁡(E^c).(15)\boldsymbol{\mu}_c = \frac{1}{|\widehat{\mathcal{E}}_c|} \sum_{\mathbf{e} \in\widehat{\mathcal{E}}_c} \mathbf{e}, \quad\boldsymbol{\Sigma}_c = \operatorname{Cov}(\widehat{\mathcal{E}}_c). \tag*{(15)}

To enhance distributional stability, we adapt the estimated Gaussian parameters by fusing the distributional statistics of base classes Cbase\mathcal{C}_{\mathrm{base}} into the attack class cc. Let (μb,Σb)(\boldsymbol{\mu}_b,\boldsymbol{\Sigma}_b) denote the mean and covariance of a base class b∈Cbaseb \in\mathcal{C}_{\mathrm{base}}, and let NbN_b be the number of samples. The similarity between class bb and cc is measured by the Euclidean distance db=∥μc−μb∥2d_b = \lVert\boldsymbol{\mu}_c-\boldsymbol{\mu}_b\rVert_2. We assign normalized weights to these base classes as:

ωb=1/(Nb⋅db)∑b∈Cbase1/(Nb⋅db).(16)\omega_b = \frac{1/(N_b \cdot d_b)}{\sum_{b \in\mathcal{C}_{\mathrm{base}}} 1/(N_b \cdot d_b)}. \tag*{(16)}

The calibrated Gaussian parameters are then computed as:

μc′=ϵ∑b∈Cbaseωbμb+(1−γ)μc,(17)\boldsymbol{\mu}'_c = \epsilon\sum_{b \in\mathcal{C}_{\mathrm{base}}} \omega_b \boldsymbol{\mu}_b + (1-\gamma)\boldsymbol{\mu}_c, \tag*{(17)}
Σc′=ϵ∑b∈CbaseωbΣb+(1−γ)Σc+I,(18)\boldsymbol{\Sigma}'_c = \epsilon\sum_{b \in\mathcal{C}_{\mathrm{base}}} \omega_b \boldsymbol{\Sigma}_b + (1-\gamma)\boldsymbol{\Sigma}_c + \mathbf{I}, \tag*{(18)}

where ϵ∈[0,1]\epsilon\in[0,1] and γ∈[0,1]\gamma\in[0,1] control the fusion ratio. Finally, κ=⌊ρK⌋\kappa= \lfloor\rho K \rfloor synthetic embeddings are sampled from N(μc′,Σc′)\mathcal{N}(\boldsymbol{\mu}'_c,\boldsymbol{\Sigma}'_c) and added to the denoised subset E^c\widehat{\mathcal{E}}_c to restore a total of KK samples per class. This calibrated Gaussian sampling strategy effectively preserves discriminative and stable feature representations under both label noise and few-shot conditions.

Experimental Setup

In this section, we present the experimental setup adopted in our evaluation. § 7-A describes the threat model and the related dataset. Next, § 7-B reports the main characteristics defining the FSCIL setup. Finally, § 7-C introduces the performance metrics.

Threat Model & Datasets

In this paper, we tackle a threat model based on flooding, information gathering, brute-force, injection, man-in-the-middle, and malware attacks.

  • Flooding attacks aim to make targeted resources unavailable by overwhelming them with a large volume of traffic. Flooding is particularly dangerous in IoT environments, where compromised devices can be organized into botnets that generate massive coordinated traffic.

  • Information Gathering includes activities aimed at discovering vulnerabilities, weak points, and sensitive information about a target resource that can be later exploited.

  • Brute-Force attacks refer to an effort to gain unauthorized access to a system by systematically attempting multiple username and password combinations.

  • Injection involves uploading malicious input to a system in order to manipulate its execution logic, access sensitive information, or execute unauthorized commands.

  • Man-In-The-Middle (MITM) attacks occur when an adversary secretly intercepts the communication between two

parties, allowing the attacker to eavesdrop on sensitive data or manipulate transmitted information.

  • Malware refers to malicious code that, once installed on a victim system, can perform harmful actions such as stealing sensitive information, disrupting system operations, or enabling remote control by an attacker.

To represent this threat model, we selected three network intrusion detection datasets: CSE-CIC-IDS2018 [47], Edge-IIoT [48], and IoT-NID [49]. This selection is motivated by the fact that they include attack classes aligned with the threat categories described above. Moreover, (i) they cover a wide range of attack scenarios across enterprise, IoT, and Industrial IoT (IIoT) environments; (ii) they are well-established and widely used in current literature [7, 21, 25, 31]; (iii) they are publicly available, ensuring reproducibility; and (iv) they are relatively recent, with the oldest dataset (CSE-CIC-IDS2018) captured in 2018 and the newest (Edge-IIoT) in 2022.

The CSE-CIC-IDS2018 dataset is a widely used benchmark for intrusion detection [7, 8, 25, 28], released by the Canadian Institute for Cybersecurity. It contains realistic benign and attack traffic captured from a simulated enterprise network. The dataset includes 13 classes (1 benign and 12 attacks), covering attacks such as DoS, DDoS, Brute Force, Web attacks, and infiltration. Rather than relying on the released pre-computed features, we extract biflows directly from the PCAP traces and subsequently revise and clean the resulting dataset following the procedure described in [31]. The resulting dataset contains ≈109k\approx109k labeled biflows.

The Edge-IIoT dataset is designed for intrusion detection in industrial IoT environments. It captures traffic from edge computing scenarios with various industrial protocols (e.g., Modbus, MQTT). The dataset includes 16 classes (1 benign and 15 attack classes), covering botnets, ransomware, scanning, and various flooding attacks. Starting from the PCAPs, we perform a cleaning phase on Edge-IIoT as in [50]. The final dataset consists of ≈731k\approx731k labeled biflows.

The IoT-NID dataset is collected from a realistic smart home environment, containing benign traffic and attacks on IoT devices such as SKT NUGU and EZVIZ Wi-Fi Camera. It includes 10 classes (1 benign and 9 attack classes), with attacks such as Mirai botnet, DoS, MITM, and port scanning. After the PCAP cleaning phase [50], it contains ≈197k\approx197k labeled biflows.

Figure 3 shows the number of biflows per class for each dataset, colored according to the attack categories defined in the threat model and ranked in decreasing order.

Figure 3. Statistics of the Number of biflows per class for CSE-CIC-IDS2018 (top), Edge-IIoT (middle) and IoT-NID (bottom) datasets. Bars with diagonal hatching represent the classes used in the incremental phase (Cnew(t)C_{\mathrm{new}}^{(t)}), while the plain bars correspond to the base classes (CbaseC_{\mathrm{base}}).

FSCIL Setup

This section describes the experimental setup used to evaluate our proposed approach. We detail the class-splitting criteria, evaluation protocol, hyperparameter settings, and implementation specifics to ensure reproducibility.

Class Splitting. All classes in each dataset are divided into base (CbaseC_{\mathrm{base}}) and new classes (Cnew(t)C_{\mathrm{new}}^{(t)}) according to the number of per-class biflows. Base classes, including benign traffic and the most frequent attacks, are used for base training, while the three classes with the fewest biflows (i.e. the rarest attacks) are treated as Cnew(t)C_{\mathrm{new}}^{(t)} during incremental learning. For simplicity, we consider a single incremental phase in the main experiments, while Appendix C extends the analysis to multiple incremental phases. Figure 3 illustrates the class split via the hatched bars.

Evaluation Scenario. Following common practice in the literature [7, 8, 27, 31], we evaluate NAFN in the FSCIL setting over 100 classification tests. Each test simulates a few-shot classification task involving base and new classes. For each task, we construct a training set containing few labeled per-class biflows (i.e. from 5 to 10) and a test set with 40 biflows per class. The training biflows of the base classes are retrieved from the memory buffer maintained by Mem+, while the training biflows of the novel classes are drawn from the corresponding dataset. This setup evaluates NAFN’s ability to adapt to new attack classes while preserving previously learned knowledge in the FSCIL setting.

Hyperparameter Setup. For the Flow Processor (see Sec. IV-A), in line with previous literature [7, 51], we use the first 20 packets of each biflow (MP=20M_P = 20) and extract 6 features from each packet (MF=6M_F = 6). These features include: (i) packet length, (ii) packet direction, (iii) TCP window size, (iv) inter-arrival time, (v) time-to-live (TTL), and (vi) TCP flags. For the feature encoder, we set the feature embedding size FF to 320. The number of downsampling operation is configured as L=2L = 2, with the corresponding channel sizes specified as Ch0=16Ch_0 = 16, Ch1=32Ch_1 = 32, and Ch2=64Ch_2 = 64. For training, we use a batch size of 64 and the Adam optimizer with a learning rate of 1×10−41 \times10^{-4}. Each model is trained for up to 100 epochs with an early-stopping strategy (patience of 20 epochs) to prevent overfitting. Hyperparameters are selected based on preliminary tuning analyses (omitted for brevity). All random seeds are fixed to 0 for reproducibility, and unless otherwise noted, the same hyperparameter configuration is applied across all datasets and models.1

Performance Metrics

In this paper, we use two performance metrics: the macro F1-score (F1 in short) and pAUC (Partial Area Under the Curve). The definitions are as follows.

Macro F1-score. It evaluates the attack classification capabilities (i.e. multi-class classification of benign and attack-specific traffic) of the NIDS. It is the harmonic mean of per-class Precision and Recall (or True Positive Rate, TPR), averaged equally across both benign and malicious classes. This ensures a fair evaluation that is not skewed by class imbalance. It is defined as:

F1-score=1∣C∣∑i=1∣C∣2×Precisioni×RecalliPrecisioni+Recalli(19)\mathrm{F1\text{-}score} = \frac{1}{\lvert C\rvert}\sum_{i=1}^{\lvert C\rvert}\frac{2 \times\mathrm{Precision}_i \times\mathrm{Recall}_i}{\mathrm{Precision}_i+\mathrm{Recall}_i} \tag*{(19)}

where CC denotes the set of all classes.

pAUC. The Area Under the Curve (AUC) evaluates the detection capabilities of the NIDS, i.e. its ability to discriminate between benign and malicious traffic in a binary classification task, by summarizing performance across all possible decision thresholds. The Receiver Operating Characteristic (ROC) curve plots the TPR against the False Positive Rate (FPR, which represents false alarms), and the AUC is the area under this curve. While the AUC provides a comprehensive view of classifier performance, it includes high-FPR regions, which are undesirable in practical NIDS deployments where excessive false positives may lead to blocking benign traffic. To better reflect realistic operational constraints, we therefore adopt the standardized pAUC, which restricts the AUC to a low-FPR range. Specifically, we consider a maximum FPR of r=0.01r = 0.01 (1%), viz.:

pAUC=12(1+∫0rTPR(FPR) dFPR−r2/2r−r2/2)(20)\mathrm{pAUC} = \frac{1}{2}\left(1+\frac{\int_{0}^{r}\mathrm{TPR}(\mathrm{FPR})\,\mathrm{dFPR}-r^2/2}{r-r^2/2}\right) \tag*{(20)}

which standardizes the partial area such that pAUC = 0.5 indicates random performance and pAUC = 1.0 indicates perfect classification. In the following, F1 and pAUC are averaged over 100 classification tasks and reported with standard deviations to assess stability.

Experimental Results

In this section, we present the empirical evaluation of NAFN. Specifically, Sec. VI-A investigates different pretraining and memory selection strategies. Sec. VI-B analyzes the sensitivity of the NIDS to the number of shots (i.e. labeled biflows from novel attacks). Sec. VI-C examines training and inference efficiency. Secs. VI-D, VI-E and VI-F study robustness and feature separability under label noise. Finally, Sec. VI-G evaluates the cross-network incremental detection performance of NAFN under label noise.

Evaluation Results under Different Pretraining Strategies and Memory Selection Methods

This experiment addresses Q1 (Sec. III), namely whether NAFN can adapt to new attack classes while retaining previously learned knowledge. To this end, we evaluate different combinations of pretraining and memory selection strategies (Mem+) across three datasets to determine the optimal configuration under few-shot conditions. In the incremental learning phase, new attack classes from the same dataset as the base classes are introduced, each containing K=10K = 10 labeled biflows. Table 2 reports F1-scores for new (F1-New), old (F1-Old), and all classes (F1-All).

MetricMem+NN Classifier: W/o Pretrain.NN Classifier: Reconstr.NN Classifier: Contras.NN Classifier: HybridLR Classifier: W/o Pretrain.LR Classifier: Reconstr.LR Classifier: Contras.LR Classifier: Hybrid
F1-NewRandom93.11 ±2.1492.81 ±2.1592.02 ±2.5193.44 ±2.0390.02 ±1.9190.53 ±1.9584.15 ±2.9090.17 ±2.38
F1-NewRainbow90.74 ±2.3692.96 ±2.4693.29 ±2.2693.35 ±2.2289.70 ±2.0490.25 ±1.8190.24 ±1.6890.64 ±1.60
F1-NewHerding90.51 ±2.1490.31 ±2.2591.22 ±2.4390.31 ±2.2385.31 ±3.0590.49 ±1.1389.01 ±1.6190.26 ±1.08
F1-OldRandom98.25 ±0.5398.26 ±0.5198.03 ±0.5798.40 ±0.4695.38 ±1.7596.00 ±0.6390.07 ±2.8995.95 ±0.66
F1-OldRainbow97.23 ±0.6298.31 ±0.5398.23 ±0.5598.38 ±0.5295.90 ±0.6095.94 ±0.5896.14 ±0.6395.95 ±0.62
F1-OldHerding96.70 ±0.6196.99 ±0.6097.84 ±0.6096.49 ±0.7091.19 ±3.5395.94 ±0.5395.51 ±0.6795.86 ±0.67
F1-AllRandom96.97 ±0.8196.89 ±0.7796.53 ±0.9597.16 ±0.7494.04 ±1.7194.63 ±0.8488.59 ±2.8394.50 ±0.95
F1-AllRainbow95.61 ±0.9696.97 ±0.9297.00 ±0.8797.12 ±0.8794.35 ±0.6994.52 ±0.6794.66 ±0.6494.62 ±0.66
F1-AllHerding95.15 ±0.8795.32 ±0.8996.19 ±0.9794.95 ±0.9489.72 ±3.3494.58 ±0.5893.88 ±0.7994.46 ±0.62
F1-NewRandom79.07 ±3.4877.16 ±3.5574.35 ±3.7975.62 ±3.5782.33 ±5.4581.76 ±5.7148.84 ±4.3282.82 ±4.27
F1-NewRainbow76.76 ±4.4177.46 ±3.7073.70 ±3.9175.44 ±3.4953.01 ±11.9980.03 ±7.2979.72 ±7.1979.97 ±6.77
F1-NewHerding82.19 ±1.9377.40 ±1.8277.50 ±3.5274.97 ±2.4982.20 ±1.2482.37 ±1.0582.37 ±1.0881.43 ±1.22
F1-OldRandom79.48 ±0.8779.51 ±0.8379.58 ±0.8179.41 ±0.8676.04 ±1.3275.74 ±1.5873.51 ±1.2676.53 ±1.26
F1-OldRainbow79.40 ±0.8379.55 ±0.8079.45 ±0.8779.80 ±0.8475.87 ±2.1975.82 ±1.6478.44 ±1.2878.04 ±1.71
F1-OldHerding80.82 ±1.1078.87 ±1.0979.95 ±1.0579.06 ±1.0779.77 ±1.1179.69 ±1.1279.66 ±1.1179.35 ±1.12
F1-AllRandom79.40 ±1.1179.04 ±1.0878.53 ±1.1278.65 ±1.1577.30 ±1.1676.94 ±0.7168.58 ±0.7677.79 ±0.74
F1-AllRainbow78.88 ±1.1879.13 ±1.1178.30 ±1.1978.93 ±1.0371.30 ±3.1976.66 ±0.8578.70 ±1.2978.42 ±0.91
F1-AllHerding81.09 ±1.1178.58 ±1.0179.46 ±1.2778.24 ±1.1180.25 ±0.9880.22 ±1.0080.20 ±0.9779.77 ±1.00
F1-NewRandom84.83 ±3.1584.89 ±3.2185.03 ±3.3484.08 ±3.5183.79 ±3.3982.98 ±5.0186.19 ±2.5885.43 ±3.04
F1-NewRainbow84.20 ±3.5783.71 ±3.7286.05 ±2.8484.40 ±3.4883.26 ±3.4983.25 ±1.4684.51 ±3.9884.48 ±3.44
F1-NewHerding79.86 ±3.8577.78 ±5.0581.01 ±3.8383.46 ±3.0480.39 ±4.7281.24 ±4.8381.45 ±4.5983.31 ±4.11
F1-OldRandom96.19 ±0.9296.46 ±0.9496.03 ±1.0896.87 ±1.0096.03 ±0.7796.34 ±0.7796.33 ±0.7396.23 ±0.80
F1-OldRainbow96.19 ±0.8996.59 ±0.9997.11 ±0.7896.95 ±0.8795.94 ±0.9196.59 ±0.7396.54 ±0.6796.56 ±0.78
F1-OldHerding92.96 ±2.2091.64 ±2.9288.25 ±2.4494.50 ±1.3394.57 ±2.8195.62 ±2.0391.32 ±4.5395.88 ±1.67
F1-AllRandom92.78 ±1.3992.99 ±1.3692.73 ±1.5393.03 ±1.5592.36 ±1.4192.33 ±1.6893.29 ±1.1292.99 ±1.32
F1-AllRainbow92.59 ±1.4892.73 ±1.4693.79 ±1.2293.18 ±1.1992.13 ±1.5492.59 ±1.6692.93 ±1.5092.93 ±1.33
F1-AllHerding89.03 ±2.4089.47 ±3.3686.08 ±2.3791.19 ±1.6990.31 ±3.0591.30 ±2.4188.36 ±3.8692.11 ±2.04

Table 2. TABLE II: Evaluation results on (a) CSE-CIC-IDS2018, (b) Edge-IIoT, and (c) IoT-NID under different pretraining strategies and memory selection methods. NN (left, red heatmap) and LR (right, blue heatmap) are shown side-by-side. For each dataset and each classifier, the entry with the highest mean F1F1-New, F1F1-Old, and F1F1-All is highlighted in bold; the corresponding standard deviation is bolded as well.

Overall, the NN classifier outperforms the LR by an average of 1.37% F1-All. Therefore, the following analyses focus on the results obtained with the NN classifier, while observations regarding LR will only be briefly mentioned.

Performance on CSE-CIC-IDS2018. Hybrid + Random achieves the best overall performance, with F1-New=93.44%, F1-Old=98.40%, and F1-All=97.16% (see Table II(a)). CSE-CIC-IDS2018 contains complex and fine-grained traffic patterns, where Hybrid pretraining provides richer representations by combining reconstruction and contrastive objectives, while Random memory selection avoids the bias of ranking-based heuristics and keeps the retained biflows sufficiently diversified for adaptation.

Performance on Edge-IIoT. The best performance is obtained through W/o pretraining + Herding configuration, achieving F1-New=82.19%, F1-Old=80.82%, and F1-All=81.09% (see Table II(b)). The dataset contains diverse and noisy traffic behaviors, so selecting representative biflows via Herding preserves overall stability. Other pretraining strategies show limited gains or even degradation in F1-New.

Performance on IoT-NID. Contrastive + Rainbow achieves the best overall performance, with F1-New=86.05%, F1-Old=97.11%, and F1-All=93.79% (see Table II(c)). Contrastive pretraining yields discriminative features, while Rainbow memory selection enhances exemplar diversity, jointly supporting both new-class adaptation and old-class retention.

Takeaway. The optimal configuration varies across datasets due to differences in traffic characteristics. On CSE-CIC-IDS2018, Hybrid + Random (NN) and Contrastive + Rainbow (LR) perform best, benefiting from richer representations and informative memory selection. On Edge-IIoT, W/o pretraining + Herding dominates for both classifiers, confirming that exemplar diversity outweighs feature initialization on this dataset. On IoT-NID, contrastive pretraining is the key driver, with Contrastive + Rainbow (NN) and Contrastive + Random (LR) yielding the best trade-off between new- and old-class performance. In the following experiments, we will adopt these optimal configurations.

Sensitivity Analysis to the Number of Shots

The current section further explores Q1 by investigating how the number of shots (i.e. the number of labeled billows per new attack class) affects the adaptation ability of NAFN. We assess the stability and scalability of the model as KK increases from 5 to 10 shots, providing insight into the trade-off between sample availability and attack classification performance. As in the previous section, new and base classes belong to the same dataset, and we adopt the configuration selected in Sec. VI-A for each dataset. Figure 4(a) and (b) show the F1F1-All achieved by NAFN using the NN and LR classifiers, respectively, on the three datasets for varying numbers of shots.

Figure 4. Comparison of F1F1-All [%] for NN and LR classifiers across different numbers of shots (KK) on the three datasets. The y-axis is zoomed in between 60% and 100% for clarity.

For the NN classifier (Figure 4(a)), performance remains stable across different KK, with a slight improvement as KK increases. On CSE-CIC-IDS2018, F1F1-All stays above 92%, rising marginally from 5 to 10 shots. A similar trend appears on IoT-NID (92%–94%), while Edge-IIoT shows the lowest results (≈ 80%), peaking at 81.2% at KK = 9.

For the LR classifier (Figure 4(b)), the benefit of larger KK is more evident. On CSE-CIC-IDS2018, performance improves from 87%–88% (5–7 shots) to nearly 94% (9–10 shots), a gain of ≈ 7%. On IoT-NID, the F1F1-All remains steady (92%–93%), while on Edge-IIoT, the effect is stronger: F1F1-All increases from ≈ 71% (5–7 shots) to 80% (9–10 shots), a gain exceeding 9%.

Takeaway. As expected, the sensitivity analysis shows that increasing the number of shots improves performance for both classifiers, though the degree of improvement varies depending on the dataset. For NN, the gains are relatively small yet consistent, whereas for LR, the effect is more substantial, especially on CSE-CIC-IDS2018 and Edge-IIoT. These findings suggest that while more shots are beneficial overall, the sensitivity to sample size is highly dataset- and classifier-dependent.

Training and Inference Efficiency

TABLE III: Computational overhead across datasets. Base and incremental training times are in seconds; inference time is in microseconds per biflow.

To complement the analyses on Q1, we measure the computational efficiency of NAFN during both the base training and incremental phases. All timings are obtained with the per-dataset configuration selected in Sec. VI-A. Furthermore, we evaluate per-biflow inference latency to assess NAFN’s suitability for real-time NIDS deployment. We report the mean ± standard deviation in seconds (for training) and microseconds (for inference) across the three considered datasets.

Table III shows that the incremental training phase consistently requires far less time than any of the pretraining procedures, regardless of the dataset or strategy. For instance, on CSE-CIC-IDS2018, the heaviest pretraining strategy (Hybrid) requires over 1,400.00s, while student training completes in just 117.21s. On Edge-IIoT, which is the largest dataset, contrastive pretraining takes approximately 4,669.00s, whereas incremental training finishes in only 666.75s, which is less than 15% of the cost. A similar pattern is observed on IoT-NID, where even the lightest pretraining (W/o Pretraining, 456.39s) still exceeds the adaptation time (346.19s). Beyond the training efficiency, the bottom section of Table III highlights the real-time operational capacity of NAFN. Specifically, classifying a single incoming biflow requires merely 7.45–8.62μ\mus using the NN classifier, and 25.54–33.25μ\mus with the LR classifier. This microsecond-level latency yields a theoretical throughput capable of processing tens to hundreds of thousands of biflows per second, ensuring that NAFN will not become a bottleneck in high-speed networks.

CSE-CIC-IDS2018Edge-IIoTIoT-NID
Base Training Time (s)
W/o Pretrain139.41 ±0.46740.52 ±1.97456.39 ±1.92
Reconstruction214.95 ±0.54832.19 ±2.41490.81 ±1.27
Contrastive1,352.22 ±155.494,669.52 ±969.001,066.13 ±167.92
Hybrid1,400.56 ±113.374,125.98 ±752.351,055.94 ±152.43
Incremental Training Time (s / increment)
Per increment117.21 ±8.50666.75 ±193.44346.19 ±92.81
Inference Time (μ\mus / biflow)
NN8.45 ±10.207.45 ±5.738.62 ±9.42
LR32.47 ±15.2125.54 ±17.4233.25 ±16.72

Table III.

Takeaway. These findings underscore the practicality of the teacher–student incremental framework, RFS. Once a teacher model has been pretrained, adapting a student model to new attack classes in the incremental training phase is both fast and computationally lightweight. Coupled with the low inference latency per biflow, this dual efficiency makes the NAFN suitable for real-world NIDS deployments.

NAFN under Noisy Labels

This section addresses Q2 by assessing the robustness of NAFN to mislabeled biflows in the incremental data. Unless otherwise stated, each dataset uses the configuration selected in Sec. VI-A. We introduce controlled label noise in the new attack classes, with η=0%\eta= 0\%–50%, where η=0%\eta= 0\% represents clean labels and higher values simulate increasingly severe label corruption. Unless otherwise specified, the denoising ratio is fixed at ρ=50%\rho= 50\%. We compare four noise detection methods (Sec. IV-C)–ProtoMargin, LOF, IF, and E-CL—against a baseline without denoising approaches (briefly, w/o Denoise). In addition, we include two noisy-label learning baselines: CSIDN [52] and NCR [53]. CSIDN assigns a reliability weight to each biflow based on predictive confidence, down-weighting samples with consistently low probabilities as potential noise. NCR addresses label noise through kk-NN topological consistency in the latent space, weighting samples according to agreement with their neighborhood and reducing the influence of isolated, inconsistent biflows. Herein, both new and base classes are drawn from the same dataset. Figure 5 displays the performance in terms of F1F1-All, F1F1-New, and F1F1-Old.

Figure 5. Performance comparison of different noise detection methods and noisy-label learning baselines under a fixed denoising ratio ρ=50%\rho= 50\% and varying noise rates η=0%\eta= 0\%–50%50\% on CSE-CIC-IDS2018, Edge-IIoT, and IoT-NID with NN and LR classifiers. Plots report the F1-score for all classes (F1-All), new classes (F1-New), and old classes (F1-Old).

Overall, performance declines as noise increases from η=10%\eta= 10\% to 50%, with the largest degradation on new attacks due to spurious labels. While w/o Denoise shows high performance under low noise, its F1F1-New drops rapidly when noise exceeds 30%, often dropping below 60% and in some cases below 40% at η=50%\eta= 50\%. By contrast, ProtoMargin substantially improves robustness to noisy labels across all datasets and classifiers. For example, on CSE-CIC-IDS2018 with NN, ProtoMargin maintains an F1F1-New of 87.03% at 50% noise, compared with only 35.34% of w/o Denoise. Similarly, on Edge-IIoT, ProtoMargin doubles the F1F1-New of the baseline under high noise conditions. Even with LR, where improvements are generally smaller, ProtoMargin delivers consistent gains, highlighting that its effect is not limited to the NN classifier. Importantly, ProtoMargin filters labels of noisy biflows from Cnew(t)C_{\mathrm{new}}^{(t)}, enhancing new-attack detection without significantly affecting knowledge of existing classes.

Compared with other noise detection methods, ProtoMargin exhibits superior stability and effectiveness. E-CL shows some advantages with LR, particularly under high noise, but it does not achieve the same gains on new attacks as ProtoMargin. LOF and IF, on the other hand, perform poorly, with F1F1-New scores often dropping below those of w/o Denoise, indicating that generic outlier detection approaches are ill-suited for incremental scenarios where noise is structured and class-specific. It is worth noting that all methods yield lower F1F1-Old scores w.r.t. w/o Denoise. Such a decline occurs because the denoising process inevitably introduces small perturbations to the decision boundaries of old classes, causing minor performance degradation. However, this drop is relatively modest and acceptable when weighed against the gains in F1F1-All scores. Furthermore, when evaluated against noisy-label learning baselines (CSIDN and NCR), ProtoMargin continues to show clear advantages in the incremental setting. Although CSIDN and NCR exhibit some resilience against spurious labels w.r.t. w/o Denoise, they struggle to adapt to new attacks under severe noise (e.g., η≥40%\eta\ge40\%), resulting in sub-optimal F1-New. Moreover, lacking a denoising mechanism to preserve past knowledge, these baselines show a larger drop in F1-Old. Conversely, ProtoMargin better isolates noisy samples without distorting the decision boundaries, yielding superior F1-All. Overall, ProtoMargin achieves the best trade-off, it mitigates the effects of label noise on new attacks, sustains competitive overall F1-scores, and preserves stability on base classes. At η=0%\eta= 0\% and ρ=50%\rho= 50\%, denoising causes a limited overall performance loss. Across all methods, the reduction in F1-All remains within ≈10%\approx10\%, while F1-New and F1-Old decrease by up to approximately 32% and 4%, respectively, with occasional improvements in some settings. For ProtoMargin, F1-All typically decreases by only 1%–5% and F1-Old by less than 2%, while F1-New shows a larger, dataset- and classifier-dependent drop of up to ≈20%\approx20\%. Thus, even under the ρ=50%\rho= 50\% setting, ProtoMargin incurs a limited cost on clean incremental data, mainly affecting new-class adaptation.

Takeaway. Addressing label noise in incremental learning is critical, as noise in new attacks can degrade overall performance. ProtoMargin is more stable than w/o Denoise, other noise detection methods, and noisy-label baselines, especially at medium to high noise levels. Moreover, it preserves accuracy on new attacks while keeping base-class performance stable. Therefore, we adopt ProtoMargin as the core of the Noise-Aware Module.

Visual Analysis of NAFN

The following visualization experiment further supports by illustrating how NAFN enhances feature separability under noisy conditions. The analysis uses ProtoMargin as the noise detector, together with the per-dataset configuration selected in Sec. VI-A. Specifically, we visualize the confusion matrices and t-SNE projections of NAFN using the NN and LR classifiers under η=50%\eta= 50\% label noise, as well as the feature distributions of new attack classes.

Confusion Matrices. As shown in Figure 6, each row corresponds to a dataset (CSE-CIC-IDS2018, Edge-IIoT, and IoT-NID). The four column reports results for NN (left) and

Confusion matrices of NN and LR classifiers

Figure 6. Confusion matrix of NN and LR classifiers on CSE-CIC-IDS2018, Edge-IIoT, and IoT-NID with 50% label noise. Each row corresponds to one dataset. The first two columns show results for the NN classifier without and with NAFN (ProtoMargin as noise detection method), respectively; the last two columns present the corresponding results for the LR classifier. We report TPR at a 1% FPR constraint above each subfigure. The theoretical upper bound (i.e. the maximum achievable TPRFPR=1%\mathrm{TPR}_{\mathrm{FPR}=1\%} when trained on 0% noise) is provided in the sub-captions.

(a) CSE-CIC-IDS2018. 0% noise bounds: NN: 82.13%, LR: 96.64% Label encoding: a = DoS GoldenEye, b = DoS Hulk, c = DDoS HOIC, d = Bot, e = Bruteforce-SSH, f = Benign, g = DDoS LOIC-HTTP, h = DOS Slowloris, i = Bruteforce-Web, j = DDoS LOIC-UDP, k = Bruteforce-XSS, l = SQL Injection.

(b) Edge-IIoT. 0% noise bounds: NN: 84.68%, LR: 98.81%. Label encoding: A\mathcal{A} = Benign, B\mathcal{B} = Password Attack, C\mathcal{C} = DDoS UDP Flooding, D\mathcal{D} = DDoS ICMP Flooding, E\mathcal{E} = DDoS HTTP Flooding, F\mathcal{F} = DDoS TCP SYN Flooding, G\mathcal{G} = Port Scanning, H\mathcal{H} = Uploading Attack, I\mathcal{I} = SQL Injection, J\mathcal{J} = Vulnerability Scanner, K\mathcal{K} = XSS, L\mathcal{L} = Backdoor, M\mathcal{M} = Ransomware Attack, N\mathcal{N} = OS Fingerprinting, O\mathcal{O} = MiTM Attack.

(c) IoT-NID. 0% noise bounds: NN: 69.60%, LR: 62.68%. Label encoding: α\alpha = Benign, β\beta = DoS SYN Flooding, γ\gamma = Mirai ACK Flooding, δ\delta = Port Scanning, ϵ\epsilon = Mirai HTTP Flooding, ζ\zeta = Host Discovery, η\eta = Mirai UDP Flooding, θ\theta = OS Detection, ι\iota = MiTM ARP Spoofing, κ\kappa = Mirai Host Bruteforce.

LR (right), both with and without NAFN (with ProtoMargin). Across all datasets, label noise mainly affects new attacks located in the lower-right region of each confusion matrix. Without NAFN, classifiers exhibit greater confusion, as reflected by the fading of diagonal elements (which is particularly pronounced in Edge-IIoT and IoT-NID). On the other hand, with NAFN, misclassifications are greatly reduced, as can be seen from the diagonal. This outcome underscores that the Noise-Aware Module effectively filters mislabeled biflows and enhances intra-class consistency. Moreover, to address strict operational constraints, we report the binary detection performance (TPRFPR=1%\mathrm{TPR}_{\mathrm{FPR}=1\%}) above each subfigure. These metrics confirm that NAFN not only recovers the fine-grained semantic boundaries of specific attacks, but also maintains a highly robust detection rate that approaches the theoretical upper bound achieved in the noiseless setting. Finally, the upper-left regions (CbaseC_{\mathrm{base}}) remain stable under both noisy and denoised conditions, confirming that label noise primarily affects Cnew(t)C_{\mathrm{new}}^{(t)}.

t-SNE

Figure 7 reports the Kernel Density Estimation (KDE) plots generated from 2D t-SNE projection, illustrating the feature distributions of new attack biflows under noisy conditions. Consistent with the setup in Figure 6, each row corresponds to a dataset (CSE-CIC-IDS2018, Edge-IIoT, and IoT-NID), while the four columns show the results of NN and LR classifiers, both with and without NAFN. Projections show that NAFN substantially enhances feature separability across all three datasets. Specifically, when not using NAFN (columns 1 and 3), the feature distributions of the three new classes almost completely overlap, making them indistinguishable. By contrast, with NAFN (columns 2 and 4), the class-specific clusters are much more distinct, highlighting an improved discriminative structure of the feature space.

Figure 7. KDE plot of new attacks affected by label noise, obtained via 2D t-SNE projection. Label encoding is the same as in Figure 6.

Takeaway. Confusion matrices and t-SNE provide a visual corroboration of the classification results: label noise mainly harms the detection of new attacks, while NAFN effectively restores their separability, thereby improving robustness under noisy-label incremental-learning scenarios.

Analysis of Early Detection and Time-to-Insight of NAFN

To further address Q2, we evaluate the real-time detection ability of NAFN under label noise (η=50%\eta= 50\%), confirming its effectiveness for early detection. This analysis focuses on CSE-CIC-IDS2018 and uses the corresponding configuration selected in Sec. VI-A. In detail, we investigate the performance under varying time thresholds TsT_s, which directly dictate the Time-to-Insight (TTI). TTI is defined as the duration from the arrival of the initial packet of a biflow to its final classification [7], and it dominates inference latency, far exceeding the overhead of feature extraction and embedding. While lower TsT_s values enhance real-time responsiveness, they increase vulnerability to slow-rate flooding attacks; conversely, higher TsT_s values improve detection accuracy but delay biflow classification. In this analysis, we focus on CSE-CIC-IDS2018 due to the presence of slow-rate flooding attacks.

Figure 8 illustrates the confusion matrices and corresponding F1F1-All scores across Ts∈{1s,5s,10s,50s,100s,MAXb}T_s \in\{1s, 5s, 10s, 50s, 100s, \mathrm{MAX}_b\}, where MAXb=330s\mathrm{MAX}_b = 330s denotes the maximum flow duration. Despite noise interference, we observe a significant performance leap as TsT_s increases from 1s to 10s (i.e. ≈+7%\approx+7\% F1F1-All for NN and LR). Beyond the 10s mark, the detection performance enters a stable plateau, with gains below 1%. Although the highest F1F1-All (95.00% for NN and 92.84% for LR) values are achieved at Ts=MAXbT_s = \mathrm{MAX}_b, results show that Ts=50sT_s = 50s offers the best balance.

Time-to-Insight versus detection performance under label noise

Figure 8. Analysis of Time-to-Insight (TTI) versus detection performance under label noise (η=50%\eta= 50\%) on CSE-CIC-IDS2018. The plots illustrate the F1-All scores for NN and LR classifiers as a function of the time threshold TsT_s. Label encoding: a = DoS GoldenEye, b = DoS Hulk, c = DDoS HOIC, d = Bot, e = Bruteforce-SSH, f = Benign, g = DDoS LOIC-HTTP, h = DOS Slowloris, i = Bruteforce-Web, j = DDoS LOIC-UDP, k = Bruteforce-XSS, l = SQL Injection. (a) NN classifier. (b) LR classifier.

Takeaway. NAFN reaches near-peak accuracy within 10s and achieves the best trade-off at Ts=50sT_s = 50s, reducing detection latency by 6× while remaining robust under 50% label noise and effectively mitigating slow-rate attacks.

Cross-Network Incremental Detection Performance

This section tackles Q3, focusing on whether NAFN can consistently sustain robust and generalizable detection performance across diverse network environments. To this end, we evaluate the cross-network incremental detection capability of NAFN by training on traffic from one dataset and incrementally introducing new attack classes from a different dataset, while using the same base and new classes defined in § 7-B. Base training uses, for each base dataset, the configuration selected in Sec. VI-A, and the incremental phase reuses the same encoder and classifier setup with the new classes drawn from the other dataset. To analyze performance under this cross-network setup, we report three distinct pAUCs. Each metric is defined based on the origin and role of the malicious classes involved. Specifically, (i) pAUCbase−mal_{\mathrm{base-mal}}: evaluates the ability to retain discrimination between benign and base malicious traffic, where all attacks from the base dataset are grouped into a single malicious class (as explained in § 7-C); (ii) pAUCinc−mal_{\mathrm{inc-mal}}: measures the ability to detect newly introduced malicious traffic from a different dataset during the incremental learning phase; (iii) pAUCunk−inc_{\mathrm{unk-inc}}: assesses the detection of unseen malicious traffic from a different network environment. It considers the base classes of the incremental dataset which are observed neither during base training nor during the incremental phase, and are therefore unknown at test time. Table IV reports the three pAUCs for each base–incremental dataset pair, using the NN and LR classifiers. Results are shown without NAFN—both without noise (η=0%\eta= 0\%) and with noise (η=50%\eta= 50\%)—as well as for NAFN with noise (η=50%\eta= 50\%).

Cross-network incremental detection performance measured by pAUCbase−mal_{\mathrm{base-mal}}[%], pAUCinc−mal_{\mathrm{inc-mal}}[%], and pAUCunk−inc_{\mathrm{unk-inc}}[%], comparing benign samples against, respectively, base malicious classes, newly introduced incremental malicious classes, and incremental-dataset base malicious classes treated as unknown. The setting uses CbaseC_{\mathrm{base}} from one dataset and Cnew(t)C_{\mathrm{new}}^{(t)} from a different network environment. Red cells indicate results without NAFN, while blue cells indicate results with NAFN.

(a) NN Classifier

Base DatasetIncr. DatasetLabel NoisepAUCbase−mal_{\mathrm{base-mal}}pAUCinc−mal_{\mathrm{inc-mal}}pAUCunk−inc_{\mathrm{unk-inc}}
CSE-CIC-IDS2018Edge-IIoT0%88.1297.4660.85
CSE-CIC-IDS2018Edge-IIoT50%85.0782.2661.83
CSE-CIC-IDS2018Edge-IIoT50%88.1295.6864.10
CSE-CIC-IDS2018IoT-NID0%90.0158.8950.72
CSE-CIC-IDS2018IoT-NID50%89.6857.2152.22
CSE-CIC-IDS2018IoT-NID50%93.4563.4556.49
Edge-IIoTCSE-CIC-IDS20180%99.9299.9893.57
Edge-IIoTCSE-CIC-IDS201850%99.5898.4192.62
Edge-IIoTCSE-CIC-IDS201850%99.9099.9594.68
Edge-IIoTIoT-NID0%99.7794.0788.71
Edge-IIoTIoT-NID50%99.2890.0383.91
Edge-IIoTIoT-NID50%99.3691.9784.30
IoT-NIDCSE-CIC-IDS20180%94.6495.9672.05
IoT-NIDCSE-CIC-IDS201850%92.4784.0062.45
IoT-NIDCSE-CIC-IDS201850%92.4996.6873.13
IoT-NIDEdge-IIoT0%98.4293.9266.96
IoT-NIDEdge-IIoT50%99.3676.5365.34
IoT-NIDEdge-IIoT50%99.4290.0666.11

(b) LR Classifier

Base DatasetIncr. DatasetLabel NoisepAUCbase−mal_{\mathrm{base-mal}}pAUCinc−mal_{\mathrm{inc-mal}}pAUCunk−inc_{\mathrm{unk-inc}}
CSE-CIC-IDS2018Edge-IIoT0%98.3291.5564.31
CSE-CIC-IDS2018Edge-IIoT50%96.2991.3163.08
CSE-CIC-IDS2018Edge-IIoT50%96.3492.5463.28
CSE-CIC-IDS2018IoT-NID0%95.2776.6764.91
CSE-CIC-IDS2018IoT-NID50%95.0373.8961.92
CSE-CIC-IDS2018IoT-NID50%95.0574.8165.01
Edge-IIoTCSE-CIC-IDS20180%99.79100.0093.95
Edge-IIoTCSE-CIC-IDS201850%99.7998.0893.44
Edge-IIoTCSE-CIC-IDS201850%99.79100.0094.93
Edge-IIoTIoT-NID0%99.9399.6297.56
Edge-IIoTIoT-NID50%99.8294.1596.97
Edge-IIoTIoT-NID50%99.8295.9396.99
IoT-NIDCSE-CIC-IDS20180%88.1295.1963.69
IoT-NIDCSE-CIC-IDS201850%87.4085.4459.54
IoT-NIDCSE-CIC-IDS201850%88.1089.1659.70
IoT-NIDEdge-IIoT0%92.3880.5063.93
IoT-NIDEdge-IIoT50%92.1771.1962.18
IoT-NIDEdge-IIoT50%92.2078.0662.51

Table IV.

Regarding the NN classifier (Table IV(a)), NAFN exhibits strong detection performance according to all three pAUCs. Detection of base malicious classes remains consistently high, with pAUCbase−mal_{\mathrm{base-mal}} values often exceeding 95%, indicating that the NIDS effectively retains previous knowledge even in the presence of domain shifts. In contrast, the performance on pAUCinc−mal_{\mathrm{inc-mal}} and pAUCunk−inc_{\mathrm{unk-inc}} varies noticeably across dataset pairs. Particularly, combinations involving CSE-CIC-IDS2018 and IoT-NID show greater degradation, reflecting a larger distributional gap. Nonetheless, NAFN mitigates the impact of label noise and domain shift, improving the detection of new and unknown attacks. For example, when adapting from IoT-NID to CSE-CIC-IDS2018, NAFN improves pAUCinc−mal_{\mathrm{inc-mal}} from 84.00% to 96.68%, and pAUCunk−inc_{\mathrm{unk-inc}} from 62.45% to 73.13%. Such gains highlight the effectiveness of NAFN in noise filtering and stabilizing incremental adaptation.

The LR classifier (Table IV(b)) exhibits a more stable yet slightly more conservative performance profile. Although pAUCbase−mal_{\mathrm{base-mal}} is consistently high (above ≈95%\approx95\%), the metrics involving cross-network generalization, namely pAUC$_{\mathrm{inc-mal}} and pAUCunk−inc_{\mathrm{unk-inc}}, show moderate drops, especially when IoT-NID serves as either the base or incremental dataset. Despite this, NAFN again provides consistent improvements in all settings, albeit with smaller margins w.r.t. NN. These outcomes indicate that LR benefits from noise-aware filtering, although its feature representation is inherently less sensitive to label noise than the NN classifier.

Takeaway. Cross-network experiments show that both NN and LR can adapt to unseen attack classes from heterogeneous environments, with generalization varying by dataset pair. Across all three pAUCs, NAFN consistently improves performance by mitigating label noise and enhancing robustness to unseen malicious biflows. These results indicate that NAFN supports reliable incremental learning and strengthens cross-network transferability under both clean and noisy label conditions.

Conclusions & Future Perspectives

In this paper, we propose NAFN, a Noise-Aware Few-Shot Class-Incremental Learning framework for Network Intrusion Detection Systems (NIDSs). NAFN introduces a teacher–student adaptation approach and a Noise-Aware Module to enable continual adaptation to new attack classes while mitigating the detrimental effects of noisy labels. Through extensive evaluations across three benchmark datasets, we validate the effectiveness of NAFN by addressing a comprehensive set of research questions (Sec. III). With regard to Q1, our experiments show that NAFN can efficiently adapt to new attacks under a few-shot regime while preserving performance on previously learned classes. For Q2, the proposed Noise-Aware Module, via the Prototype-Margin method, significantly ends_mid=1 improves robustness against mislabeled biflows. At label-noise ratios ranging from 10% to 50%, the F1-score on new classes improves by up to +52% w.r.t. the baseline without denoising, consistently outperforming alternative noise detection methods while preserving the separability of new-class representations. Finally, regarding Q3, our cross-network experiments reveal that NAFN maintains stable and transferable detection capabilities across heterogeneous network environments. Even under severe label noise and pronounced domain shifts, NAFN consistently improves cross-network incremental detection, with observed pAUC gains of up to 13% and 11% for new and previously unseen attacks, respectively.

Limitations & Future Avenues. The findings of this manuscript suggest several promising directions for future research to address the current limitations of NAFN. (i) Retransmissions and packet loss in dynamic network environments may alter traffic features, potentially affecting the robustness of NAFN. Future work could address this limitation through adaptive feature extraction or more robust representation learning techniques [54]. (ii) Traffic drift and memory bias accumulation during long-term incremental updates may be reduced by developing scalable memory management strategies or continual prototype calibration methods [55], improving model stability in online or extended deployments. (iii) Explainable AI can increase the transparency and interpretability of the model [50], enabling security operators to better understand detection decisions and enhancing usability in real-world scenarios. (iv) NAFN assumes that the presence of label noise is known; future work could detect label corruption through confidence monitoring or prototype consistency, automatically triggering the denoising pipeline. (v) The paper assumes a symmetric distribution of noise across the new classes. Future work could investigate asymmetric noise distributions based on attack-type similarity.

Appendix

Hyperparameter Sensitivity Analysis

In this section, we conduct a sensitivity analysis of the hyperparameters (ϵ,γ,ρ)(\epsilon,\gamma,\rho) related to the feature sampling module (Sec. IV-C). Specifically, ϵ\epsilon and γ\gamma control the fusion rates for the base classes CbaseC_{\mathrm{base}} and the novel classes CnewC_{\mathrm{new}} (cf. Eqs. (17) and (18)), respectively, while ρ\rho controls the denoising ratio. We vary ϵ\epsilon and γ\gamma over the interval [0.1,0.9][0.1,0.9], while setting ρ\rho within [0.1,0.5][0.1,0.5]. Unless otherwise specified, the default setting is ϵ=γ=0.7\epsilon=\gamma=0.7 and ρ=0.5\rho=0.5. To isolate the effect of each factor, we adopt a one-at-a-time protocol: when tuning one hyperparameter, the others are fixed at their default values.

Figure 9 shows the F1-All curves of NAFN over the three hyperparameters on CSE-CIC-IDS2018, Edge-IIoT, and IoT-NID, using two classifiers (NN and LR) under label noise with η=50%\eta=50\%. Overall, NAFN remains stable across ϵ\epsilon and γ\gamma. Changing the fusion rates leads to only marginal performance fluctuations, suggesting that the model is weakly sensitive to the mixture weights between CbaseC_{\mathrm{base}} and CnewC_{\mathrm{new}}. In contrast, ρ\rho has a stronger effect since it controls the denoising strength. As ρ\rho increases, NAFN achieves better detection performance under η=50%\eta=50\% label noise, implying that stronger denoising is beneficial when supervision is heavily corrupted. Notably, the best performance is obtained when ρ\rho is close to the true label-noise ratio η\eta, which aligns with the intuition that the denoising ratio should match the corruption level and further corroborates the effectiveness of the Noise-Aware Module. Meanwhile, NAFN remains robust even with conservative denoising (e.g., ρ=0.1\rho=0.1). Despite 50% noise, performance does not drop significantly, showing that the framework does not rely on aggressive denoising to work well.

Figure 9. Sensitivity analysis of the Feature Sampling Module hyperparameters (ϵ,γ,ρ)(\epsilon, \gamma, \rho) on CSE-CIC-IDS2018, Edge-IIoT, and IoT-NID with NN and LR under 50% label noise. Columns correspond to ϵ\epsilon, γ\gamma, and ρ\rho; rows to CSE-CIC-IDS2018, Edge-IIoT, and IoT-NID.

In summary, NAFN is largely insensitive to (ϵ,γ,ρ)(\epsilon,\gamma,\rho). In particular, ϵ\epsilon and γ\gamma can be chosen from a broad range without noticeable impact, while ρ\rho provides a controllable knob that adaptively improves performance as the noise level increases.

Ablation of Feature Sampling Module

DatasetClassifierSettingF1-AllF1-NewF1-Old
CSE-CIC-IDS2018NNDenoise-only94.96%87.04%97.59%
CSE-CIC-IDS2018NNDenoise + MixUp94.98%87.00%97.65%
CSE-CIC-IDS2018NNDenoise + SMOTE95.00%86.91%97.65%
CSE-CIC-IDS2018NNDenoise + Ours95.01%87.02%97.66%
CSE-CIC-IDS2018LRDenoise-only78.66%32.74%93.97%
CSE-CIC-IDS2018LRDenoise + MixUp92.81%82.94%96.18%
CSE-CIC-IDS2018LRDenoise + SMOTE92.75%82.17%96.19%
CSE-CIC-IDS2018LRDenoise + Ours92.84%82.74%96.21%
Edge-IIoTNNDenoise-only77.15%64.93%80.20%
Edge-IIoTNNDenoise + MixUp77.56%65.65%80.35%
Edge-IIoTNNDenoise + SMOTE77.46%65.81%80.38%
Edge-IIoTNNDenoise + Ours77.35%65.91%80.21%
Edge-IIoTLRDenoise-only64.26%17.08%76.06%
Edge-IIoTLRDenoise + MixUp73.58%46.88%78.86%
Edge-IIoTLRDenoise + SMOTE73.39%56.75%78.80%
Edge-IIoTLRDenoise + Ours73.25%56.19%77.51%
IoT-NIDNNDenoise-only85.53%59.90%96.52%
IoT-NIDNNDenoise + MixUp85.90%60.41%96.76%
IoT-NIDNNDenoise + SMOTE85.93%60.80%96.70%
IoT-NIDNNDenoise + Ours85.87%60.50%96.74%
IoT-NIDLRDenoise-only78.27%48.79%90.90%
IoT-NIDLRDenoise + MixUp86.43%64.21%95.96%
IoT-NIDLRDenoise + SMOTE86.45%64.20%95.98%
IoT-NIDLRDenoise + Ours86.48%64.36%95.97%

Table 5. Ablation of post-denoising compensation strategies. Denoise-only is compared with embedding-space compensation via MixUp, SMOTE, and Ours (Gaussian embedding synthesis fitted on the remaining samples). We report F1-All, F1-New, F1-Old [%].

In the following, we ablate the post denoising compensation stage. Specifically, after the noise detection module, we compare Denoise-only (no compensation) with three embedding-space compensation strategies: MixUp, SMOTE, and Ours (Gaussian embedding synthesis fitted on the remaining samples). Experiments are conducted on the three datasets, using NN and LR. Table V reports F1-All, F1-New, and F1-Old.

Overall, Denoise-only is insufficient and can significantly degrade performance after samples are filtered out. This issue is particularly pronounced for LR, which relies on adequate coverage of the feature space. For instance, on CSE-CIC-IDS2018 with LR, Denoise-only yields only 78.66% F1-All and 32.74% F1-New, resulting in weaker generalization to new classes due to the lack of compensation. On the other hand, biflow compensation restores and often improves performance, suggesting that denoising and compensation play complementary roles: denoising improves sample reliability, while compensation mitigates the distribution gaps caused by filtering. Moreover, our Gaussian embedding synthesis (Denoise+Ours) performs on par with widely-used alternatives such as MixUp and SMOTE in embedding space. Notably, on CSE-CIC-IDS2018 with NN, Denoise+Ours achieves the best results (95.01% F1-All and 87.02% F1-New), slightly outperforming the baselines. These results confirm that post-denoising compensation is crucial for maintaining performance under few-shot filtering, and our approach provides competitive (and occasionally superior) gains relative to standard embedding-space augmentation methods.

Multiple Incremental Results

To complement the single-session protocol used in the main evaluation, we further assess NAFN under a multi-step incremental setting. For each dataset, the rare attack classes originally assigned to Cnew(t)C_{\mathrm{new}}^{(t)} are introduced sequentially over three incremental steps, with one new class added at each step. At step #t\#t, the model is adapted using the available few-shot samples of the current new class, while the previously observed classes are retained through the memory buffer. The evaluation set then includes all classes observed up to that step, allowing us to measure both the adaptation to the newly introduced attack and the preservation of previously acquired knowledge. We keep the same experimental setup used in the main experiments; values are averaged over 100 tasks and reported as mean F1-score with standard deviation.

DatasetClassifierStepF1-AllF1-NewF1-Old
CSE-CIC-IDS2018NN#199.12 ±0.3996.71 ±1.5099.38 ±0.31
CSE-CIC-IDS2018NN#299.06 ±0.3799.86 ±0.4298.98 ±0.40
CSE-CIC-IDS2018NN#397.18 ±0.6585.18 ±4.0798.27 ±0.40
CSE-CIC-IDS2018LR#199.08 ±0.6596.29 ±1.5799.40 ±0.26
CSE-CIC-IDS2018LR#299.17 ±0.3699.95 ±0.2499.09 ±0.39
CSE-CIC-IDS2018LR#394.70 ±0.7076.20 ±4.0396.39 ±0.60
Edge-IIoTNN#182.23 ±1.0792.84 ±3.1281.35 ±1.11
Edge-IIoTNN#283.11 ±1.07100.00 ±0.0081.81 ±1.15
Edge-IIoTNN#380.92 ±1.0655.33 ±4.7382.75 ±1.01
Edge-IIoTLR#182.70 ±1.0492.88 ±3.2881.86 ±1.07
Edge-IIoTLR#283.66 ±0.95100.00 ±0.0082.40 ±1.03
Edge-IIoTLR#379.99 ±1.0754.03 ±1.5481.85 ±1.08
IoT-NIDNN#196.77 ±1.1187.48 ±4.8398.10 ±0.64
IoT-NIDNN#295.21 ±1.0786.66 ±4.2796.28 ±0.87
IoT-NIDNN#393.53 ±1.2788.68 ±4.6094.07 ±1.13
IoT-NIDLR#196.67 ±0.9988.63 ±3.5497.82 ±0.69
IoT-NIDLR#294.51 ±1.1885.97 ±3.9295.58 ±1.01
IoT-NIDLR#392.93 ±1.2388.18 ±4.3193.46 ±1.14

Table VI. Multi-step incremental performance of NAFN on CSE-CIC-IDS2018, Edge-IIoT, and IoT-NID. Each step introduces one additional rare attack class. Evaluation is performed over all classes observed so far.

Table VI shows that NAFN remains effective beyond a single incremental session. Across datasets and classifiers, F1-Old stays stable after successive updates, indicating that NAFN mitigates catastrophic forgetting even when new attacks are introduced one by one. This behavior is particularly clear on CSE-CIC-IDS2018, where NN preserves F1-Old above 98% across all three steps, and on IoT-NID, where both classifiers retain more than 93% F1-Old at the final step. The overall performance also remains competitive: after three incremental steps, NAFN achieves 97.18%, 80.92%, and 93.53% F1-All with NN on CSE-CIC-IDS2018, Edge-IIoT, and IoT-NID, respectively. The main limitation appears in F1-New when the final introduced class is substantially harder or less separable. For example, on Edge-IIoT, F1-New reaches 100.00% at step #2 but drops to 55.33% for NN and 54.03% for

LR at step #3. A similar, though milder, pattern appears on CSE-CIC-IDS2018 with LR, where the final-step F1-New decreases to 76.20%. These drops highlight that multi-step FSCIL performance depends not only on the number of sessions but also on the intrinsic separability and biflow quality of the newly introduced attack class. Nevertheless, the corresponding F1-Old remains high, showing that the performance loss is concentrated on the current new class rather than caused by broad forgetting.

References

  1. [1]I. Rakine, A. Oukaira, K. El Guemmat, I. Atouf, S. Ouahabi, M. Talea, and T. Bouragba, “Comprehensive Review of Intrusion Detection Techniques: ML and DL in Different Networks,” IEEE Access, vol. 13, pp. 104 345–104 367, 2025.DOI
  2. [2]C. P. Research. (2025, Nov.) Global Cyber Attacks Surge in October 2025—Amid Explosive Ransomware Growth and Rising GenAI Threats. Accessed: 2025–11–25. [Online]. Available: https://blog.checkpoint.com/research/global-cyber-attacks-surge-in-october-2025-amid-explosive-ransomware-growth-and-rising-genai-threats/
  3. [3]Z. Song, Z. Zhao, F. Zhang, G. Xiong, G. Cheng, X. Zhao, S. Guo, and B. Chen, “t2RNN: An Incremental and Interpretable Recurrent Neural Network for Encrypted Traffic Classification,” IEEE Trans. Depend. Sec. Comput., pp. 1–14, 2023.DOI
  4. [4]X. Zhang, Y. Wang, T. Ohtsuki, G. Gui, C. Yuen, M. Di Renzo, and H. Sari, “Malware Traffic Classification via Expandable Class Incremental Learning With Architecture Search,” IEEE Trans. Inf. Forensics Security, vol. 20, pp. 6074–6085, 2025.DOI
  5. [5]Z. Zhao, Y. Wang, Y. Lai, S. Yu, and J. Shi, “MUFFIN: A Meta-Knowledge Decoupling-Based Approach to Few-Shot IoT Traffic Classification,” IEEE/ACM Trans. Netw., vol. 34, pp. 411–426, 2026.DOI
  6. [6]Z. Zhao, Y. Lai, Y. Wang, W. Jia, and H. He, “A Few-Shot Learning Based Approach to IoT Traffic Classification,” IEEE Commun. Lett., vol. 26, no. 3, pp. 537–541, 2022.DOI
  7. [7]D. Di Monda, A. Montieri, V. Persico, P. Voria, M. De Ieso, and A. Pescapé, “Few-Shot Class-Incremental Learning for Network Intrusion Detection Systems,” IEEE Open Journal of the Communications Society, vol. 5, pp. 6736–6757, 2024.
  8. [8]L. Du, Z. Gu, Y. Wang, L. Wang, and Y. Jia, “A Few-Shot Class-Incremental Learning Method for Network Intrusion Detection,” IEEE Trans. Netw. Service Manag., vol. 21, no. 2, pp. 2389–2401, 2024.
  9. [9]F. Cerasuolo, G. Bovenzi, D. Ciuzono, and A. Pescapé, “Attack-Adaptive Network Intrusion Detection Systems for IoT Networks through Class Incremental Learning,” Computer Networks, vol. 263, p. 11228, 2025.DOI
  10. [10]M. Zhang, X. Zhao, J. Yao, C. Yuan, and W. Huang, “When Noisy Labels Meet Long Tail Dilemmas: A Representation Calibration Method,” in Proc. IEEE/CVF Int. Conference on Computer Vision (ICCV), 2023, pp. 15 890–15 900.arxiv.org/abs/2211.10955
  11. [11]D. Rolnick, A. Veit, S. Belongie, and N. Shavit, “Deep Learning is Robust to Massive Label Noise,” arXiv preprint arXiv:1705.10694, 2017.arxiv.org/abs/1705.10694
  12. [12]S. Yang, L. Liu, and M. Xu, “Free Lunch for Few-shot Learning: Distribution Calibration,” in Proc. Int. Conference on Learning Representations (ICLR), 2021.arxiv.org/abs/2101.06395
  13. [13]Y. Tian, Y. Wang, D. Krishnan, J. B. Tenenbaum, and P. Isola, “Rethinking Few-Shot Image Classification: A Good Embedding is All You Need?” in Proc. European Conference Computer Vision (ECCV), 2020, pp. 266–282.arxiv.org/abs/2003.11539
  14. [14]I. O. Lopes, D. Zou, I. H. Abdulqadder, F. A. Ruambo, B. Yuan, and H. Jin, “Effective Network Intrusion Detection via Representation Learning: A Denoising Autoencoder Approach,” Computer Communications, vol. 194, pp. 55–65, 2022.DOI
  15. [15]K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick, “Momentum Contrast for Unsupervised Visual Representation Learning,” in Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020, pp. 9729–9738.arxiv.org/abs/1911.05722
  16. [16]Y. Ma, Z. Li, H. Xue, and J. Chang, “A Balanced Supervised Contrastive Learning-Based Method for Encrypted Network Traffic Classification,” Computers & Security, vol. 145, p. 104023, 2024.DOI
  17. [17]Y. Wang, H. Xu, J. Ma et al., “MTRC: A Self-Supervised Network Intrusion Detection Framework Based on Multiple Transformers-Enabled Data Reconstruction With Contrastive Learning,” Journal of Network and Computer Applications, vol. 243, p. 104300, 2025.DOI
  18. [18]S.-A. Rebuffi, A. Kolesnikov, G. Sperl, and C. H. Lampert, “iCaRL: Incremental Classifier and Representation Learning,” in Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.arxiv.org/abs/1611.07725
  19. [19]J. Bang, H. Kim, Y. Yoo, J.-W. Ha, and J. Choi, “Rainbow Memory: Continual Learning with a Memory of Diverse Samples,” in Proc. IEEE/CVF Int. Conference on Computer Vision (ICCV), 2021, pp. 8218–8227.arxiv.org/abs/2103.17230
  20. [20]T. Wang, Q. Lv, B. Hu, and D. Sun, “A Few-Shot Class-Incremental Learning Approach for Intrusion Detection,” in Proc. IEEE Int. Conference on Computer Communications and Networks (ICCCN), 2021, pp. 1–8.
  21. [21]M. Abrishami, S. Dadkhah, E. C. P. Neto, P. Xiong, S. Iqbal, S. Ray, and A. A. Ghorbani, “Label Noise Detection in IoT Security based on Decision Tree and Active Learning,” in Proc. IEEE Int. Conference on Smart Communities: Improving Quality of Life Using ICT, IoT and AI (HONET), 2022, pp. 046–053.DOI
  22. [22]Q. Yuan, C. Liu, W. Yu, Y. Zhu, G. Xiong, Y. Wang, and G. Gou, “BoAu: Malicious Traffic Detection with Noise Labels Based on Boundary Augmentation,” Computers & Security, vol. 131, p. 103300, 2023.DOI
  23. [23]Q. Yuan, G. Gou, Y. Zhu, Y. Zhu, G. Xiong, and Y. Wang, “MCRe: A Unified Framework for Handling Malicious Traffic with Noise Labels Based on Multidimensional Constraint Representation,” IEEE Trans. Inf. Forensics Security, vol. 19, pp. 133–147, 2023.DOI
  24. [24]E. Hallaji, R. Razavi-Far, M. Saif, and E. Herrera-Viedma, “Label Noise Analysis Meets Adversarial Training: A Defense Against Label Poisoning in Federated Learning,” Knowledge-Based Systems, vol. 266, p. 110384, 2023.DOI
  25. [25]Z. Wang, Y. Lu, W. Wu, Y. Lu, and H. Wang, “A Few-Shot and Anti-Forgetting Network Intrusion Detection System based on Online Meta Learning,” in Proc. IEEE Global Communications Conference (GLOBECOM), 2024, pp. 3877–3882.
  26. [26]M. Hosseini and W. Shi, “Intrusion Detection in IoT Network using Few-Shot Class Incremental Learning,” in Proc. Future of Information and Communication Conference, 2024, pp. 617–636.DOI
  27. [27]Q. P. X. Cao, D. D. Tran, S. T. T. Ngo, K. H. Nghi, D. T. Phan, and H. V. Pham, “A Study on Few-Shot Learning Approach for Intrusion Detection System with Class Incremental Learning,” in Proc. Int. Conference on Intelligent Information Technology, 2025, pp. 113–120.
  28. [28]Q. Meng, Q. Yuan, J. Tao, P. Wang, S. Lu, G. Li, Y. Wang, and X. Guan, “When Unknown Threat Meets Label Noise: A Self-Correcting Framework,” IEEE Trans. Depend. Sec. Comput., vol. 23, no. 1, pp. 905–922, 2026.
  29. [29]M. Zhan, R. Zhao, X. Deng, Z. Xue, Q. Li, Z. Liu, G. Cheng, and K. Xu, “FlowRefiner: A Robust Traffic Classification Framework against Label Noise,” in Proc. Advances in Neural Information Processing Systems, 2025.DOI
  30. [30]T. Hasan, J. Malik, I. Bibi, W. U. Khan, F. N. Al-Wesabi, K. Dev, and G. Huang, “Securing Industrial Internet of Things Against Botnet Attacks Using Hybrid Deep Learning Approach,” IEEE Trans. Netw. Sci. Eng., vol. 10, no. 5, pp. 2952–2963, 2023.
  31. [31]D. Monda, F. Rustam, A. D. Jurcut, and A. Pescapé, “Rapid Few-Shot Learning for Resilient Multi-Domain Intrusion Detection,” in Proc. IEEE Global Communications Conference (GLOBECOM), 2025.DOI
  32. [32]C. Lu, X. Wang, A. Yang, Y. Liu, and Z. Dong, “A Few-Shot Based Model-Agnostic Meta-Learning for Intrusion Detection in Security of Internet of Things,” IEEE Internet Things J., vol. 10, no. 24, pp. 21 309–21 321, 2023.DOI
  33. [33]M. Masana, X. Liu, B. Twardowski, M. Menta, A. D. Bagdanov, and J. Van De Weijer, “Class-Incremental Learning: Survey and Performance Evaluation on Image Classification,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 45, no. 5, pp. 5513–5533, 2022.DOI
  34. [34]Y. Wang, Q. Yao, J. T. Kwok, and L. M. Ni, “Generalizing from a Few Examples: A Survey on Few-Shot Learning,” ACM Computing Surveys, vol. 53, no. 3, pp. 1–34, 2020.arxiv.org/abs/1904.05046
  35. [35]X. Tao, X. Hong, X. Chang, S. Dong, X. Wei, and Y. Gong, “Few-Shot Class-Incremental Learning,” in Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020, pp. 12 183–12 192.arxiv.org/abs/2004.10956
  36. [36]D.-W. Zhou, F.-Y. Wang, H.-J. Ye, L. Ma, S. Pu, and D.-C. Zhan, “Forward Compatible Few-Shot Class-Incremental Learning,” in Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022, pp. 9046–9056.arxiv.org/abs/2203.06953
  37. [37]Q.-W. Wang, D.-W. Zhou, Y.-K. Zhang, D.-C. Zhan, and H.-J. Ye, “Few-Shot Class-Incremental Learning via Training-Free Prototype Calibration,” in Proc. Advances in Neural Information Processing Systems, vol. 36, 2023, pp. 15 060–15 076.arxiv.org/abs/2312.05229
  38. [38]C. Finn, P. Abbeel, and S. Levine, “Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks,” in Proc. Int. Conference on Machine Learning (ICML), 2017, pp. 1126–1135.arxiv.org/abs/1703.03400
  39. [39]J. Snell, K. Swersky, and R. Zemel, “Prototypical Networks for Few-Shot Learning,” in Proc. Advances in Neural Information Processing Systems, vol. 30, 2017.arxiv.org/abs/1703.05175
  40. [40]G. Apruzzese, L. Pajola, and M. Conti, “The Cross-Evaluation of Machine Learning-based Network Intrusion Detection Systems,” IEEE Trans. Netw. Service Manag., vol. 19, no. 4, pp. 5152–5169, 2022.DOI
  41. [41]A. Raghu, M. Raghu, S. Bengio, and O. Vinyals, “Rapid Learning or Feature Reuse? Towards Understanding the Effectiveness of MAML,” in Proc. Int. Conference on Learning Representations (ICLR), 2020.arxiv.org/abs/1909.09157
  42. [42]G. Jiang, J. Zhang, X. Bai, W. Wang, and D. Meng, “Which Is More Effective in Label Noise Cleaning, Correction or Filtering?” in Proc. AAAI Conference on Artificial Intelligence, vol. 38, no. 11, 2024, pp. 12 866–12 873.
  43. [43]O. Ronneberger, P. Fischer, and T. Brox, “U-Net: Convolutional Networks for Biomedical Image Segmentation,” in Proc. Medical Image Computing and Computer-Assisted Intervention (MICCAI), 2015, pp. 234–241.arxiv.org/abs/1505.04597
  44. [44]H.-J. Liao, C.-H. R. Lin, Y.-C. Lin, and K.-Y. Tung, “Intrusion Detection System: A Comprehensive Review,” Journal of Network and Computer Applications, vol. 36, no. 1, pp. 16–24, 2013.
  45. [45]C. Wang, A. Finamore, P. Michiardi, M. Gallo, and D. Rossi, “Data Augmentation for Traffic Classification,” in Proc. Passive and Active Measurement (PAM), 2024, pp. 159–186.arxiv.org/abs/2401.10754
  46. [46]X. Que and Q. Yu, “Dual-Level Curriculum Meta-Learning for Noisy Few-Shot Learning Tasks,” in Proc. AAAI Conference on Artificial Intelligence, vol. 38, no. 13, 2024, pp. 14 740–14 748.
  47. [47]I. Sharafaldin, A. H. Lashkari, and A. A. Ghorbani, “Toward Generating a New Intrusion Detection Dataset and Intrusion Traffic Characterization,” Proc. Int. Conference on Information Systems Security and Privacy (ICISSP), vol. 1, pp. 108–116, 2018.DOI
  48. [48]M. A. Farag, O. Friha, D. Hamouda, L. Maglaras, and H. Janicke, “Edge-IIoTset: A New Comprehensive Realistic Cyber Security Dataset of IoT and IIoT Applications for Centralized and Federated Learning,” IEEE Access, vol. 10, pp. 40 281–40 306, 2022.
  49. [49]H. Kang, D. H. Ahn, G. M. Lee, J. D. Yoo, K. H. Park, and H. Kim, “IoT Network Intrusion Dataset,” IEEE Dataport, 2019.
  50. [50]F. Cerasuolo, G. Bovenzi, D. Ciounzono, and A. Pescapé, “Adaptable, Incremental, and Explainable Network Intrusion Detection Systems for Internet of Things,” Engineering Applications of Artificial Intelligence, vol. 144, p. 110143, 2025.DOI
  51. [51]D. Di Monda, G. Bovenzi, A. Montieri, V. Persico, and A. Pescapé, “IoT Botnet-Traffic Classification Using Few-Shot Learning,” in Proc. IEEE Int. Conference on Big Data (BigData), 2023, pp. 3284–3293.DOI
  52. [52]A. Berthon, B. Han, G. Niu, T. Liu, and M. Sugiyama, “Confidence Scores Make Instance-Dependent Label-Noise Learning Possible,” in Proc. Int. Conference on Machine Learning (ICML), 2021, pp. 825–836.
  53. [53]A. Iscen, J. Valmadre, A. Arnab, and C. Schmid, “Learning with Neighbor Consistency for Noisy Labels,” in Proc. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022, pp. 4662–4671.arxiv.org/abs/2202.02200
  54. [54]Y. Jiang, X. Wang, Y. Lai, and Y. Wang, “A Packet Sequence Permutation-Aware Approach to Robust Network Traffic Classification,” IEEE Networking Letters, vol. 6, no. 3, pp. 203–207, 2024.
  55. [55]X. Zhang, R. Zhao, Z. Jiang, Z. Sun, Y. Ding, E. C. Ngai, and S.-H. Yang, “AOC–IDS: Autonomous Online Framework with Contrastive Learning for Intrusion Detection,” in Proc. IEEE Conference on Computer Communications (INFOCOM), 2024, pp. 581–590.arxiv.org/abs/2402.01807

Paper details

vlnc:W_5tvmdmjb
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents