Abstract
The emergence of the Internet of Things (IoT) has introduced major security challenges. Deep learning models have shown strong potential for intrusion detection. However, they often require large datasets and high computational resources. In contrast, IoT environments are resource-constrained and lack sufficient labeled data. This paper proposes a lightweight intrusion detection approach based on Long Short-Term Memory (LSTM) networks and homogeneous transfer deep learning. The model is first trained on a subset of the BoT-IoT dataset as a source domain. It is then fine-tuned on a disjoint subset containing a rare attack type. This setup represents adaptation to unseen attack behaviors within the same environment. By freezing earlier layers and fine-tuning only the final layers, the method reduces training overhead while preserving performance. This is important to meet the IoT requirement for frequent, lightweight model updates on resource-constrained devices. The proposed model achieved 99.9% accuracy, a macro F1-score of 0.96, and a 47.8% reduction in training time compared to training from scratch. Extensive experiments confirm that it maintains balanced detection across both common and rare classes.
1. Introduction
The rapid growth of the Internet of Things (IoT) has presented new security challenges. These challenges are especially apparent in intrusion detection in resource-constrained environments. Deep learning-based Intrusion Detection Systems (IDS) gained significant attention for being able to detect complex attack patterns in network traffic. However, these models often require large amounts of labeled data and processing power. In addition, they typically require full retraining to adapt when new attack behaviors emerge. This makes their deployment in IoT environments challenging [1,2,3]. As a result, many studies have applied transfer learning to reduce model complexity while maintaining high detection accuracy.
Recent research shows that transfer learning can reuse previously learned knowledge to detect new or unseen attacks with less data. This is important for IoT networks that cannot afford frequent retraining or large-scale data collection. By freezing parts of a pretrained model, it becomes possible to adapt efficiently while saving computation and energy. Such lightweight updates allow faster and more practical IDS deployment on edge devices. Therefore, transfer learning has become a prominent direction for enabling efficient, incremental adaptation in IoT intrusion detection [4].
This work proposes a lightweight transfer learning framework based on Long Short-Term Memory (LSTM) networks. Here, the term ‘lightweight’ refers primarily to reducing retraining cost through frozen recurrent layers, alongside maintaining a compact model size. This objective aligns with IoT requirements for rapid adaptation and decentralized, frequent on-device updates [5]. The framework defines a homogeneous intra-dataset transfer setup where source and target domains share the same feature space but differ by attack families and data distributions. Normal records are reused as a common background to maintain realistic traffic context without introducing leakage.
The proposed intra-dataset transfer simulates the IoT environments where new attack patterns continue to appear as deployments grow, and threats evolve over time [6]. Even with a homogeneous feature space, IoT traffic can change. This change occurs when device activity or communication patterns shift, even within the same infrastructure [7]. Moreover, constructing and labeling realistic IoT attack datasets is difficult and time consuming. This makes rapid adaptation from previously learned behaviors more practical than full retraining [6].
The approach follows strict group-aware splitting and fixed random seeds to ensure reproducibility. By fine-tuning only the dense layers, the model adapts quickly to new attack patterns while keeping training time and memory usage low. This study evaluates a practical combination of established techniques, including temporal windowing, LSTM freezing, group-aware segmentation, and rare-class handling. To the best of our knowledge, this combination has not been jointly examined for lightweight IoT intrusion detection.
The BoT-IoT dataset is used for evaluation because it includes diverse and realistic IoT attacks. The results show that the proposed approach achieves high accuracy, strong recall for rare classes, and reduced training cost, demonstrating its suitability for practical IoT deployment.
This paper makes four main contributions: (1) It presents a lightweight and effective transfer learning approach based on partial fine-tuning. (2) It defines a realistic and leakage-free source–target split of the BoT-IoT dataset, designed to emulate practical transfer learning conditions. (3) It employs sliding-window sequence construction to capture and evaluate short-term temporal patterns critical for IoT traffic analysis. (4) It addresses class imbalance by applying oversampling in the source domain and class-weights in the target domain to improve minority-class detection. The remainder of the paper is organized as follows: Section 2 provides background on transfer learning and LSTM networks. Section 3 reviews related work. Section 4 presents the dataset and preprocessing pipeline. Section 5 details the methodology and implementation. Section 6 reports results. Section 7 discusses findings and presents the study limitations and directions for future work. Finally, Section 8 concludes the paper.
2. Background
2.1. Deep Transfer Learning
Transfer learning is a machine learning framework that utilizes previously acquired knowledge to improve performance. Basically, knowledge is transferred from a source domain to a target domain. However, the two domains must be related. Usually, the target domain contains minimal to no labeled data, while the source domain contains a significant amount of labeled data [8,9]. Transfer learning is particularly useful in IoT contexts where labeled data and computational resources are limited.
Transfer learning can be categorized as either homogeneous or heterogeneous according to the feature space. This work employs homogeneous transfer learning, where the source and target domains have an identical feature space. This enables a more seamless transfer process. On the contrary, heterogeneous transfer learning involves distinct feature spaces. Domain adaptation strategies play an important role in enabling efficient knowledge transfer [4,10,11].
In deep learning, knowledge is stored in the model’s parameters or weights. Transfer learning enables transferring these parameters from a source model, which has been trained on a large dataset, to a target model. This prevents the need to train the target model from scratch. Thus, computational costs are reduced and the requirement for large labeled datasets is minimized [4,11]. Strategies used to transfer knowledge include freezing all layers except the final layer for fine-tuning, freezing most layers and tuning only the final few, or fine-tuning all layers initialized with source-domain weights [12]. Apparently, freezing more layers results in a considerable decrease in computational complexity.
Recent studies in intrusion detection demonstrate that deep transfer learning with pretrained models can substantially enhance detection performance. This improvement is achieved while requiring only limited retraining to adapt to different types of attacks. Hence, transfer learning can be a powerful approach to develop intrusion detection systems in the resource-constrained environments of IoT [8,9].
In this work, transfer learning is implemented within a supervised learning framework. Both source and target domains contain labeled traffic records. The model is trained using cross-entropy loss with explicit class supervision. The objective is to reuse temporal representations learned from labeled attack behaviors in the source domain to improve detection of different labeled attack families in the target domain. This distinguishes the proposed approach from anomaly detection, which typically models normal behavior and flags deviations as suspicious [13,14].
2.2. The Long Short-Term Memory (LSTM) Networks
LSTM is one special variant of recurrent neural network (RNN). RNNs use internal memory to capture temporal dependencies in data sequences such as text, speech, or time-series data. In RNN, the output of neurons in each hidden layer is connected to the input of all the neurons of the next layer and also to itself. Accordingly, RNN is trained using current and historic inputs. Therefore, RNN was successfully applied in intrusion detection due to its ability to learn the temporal correlations of cyberattacks by modeling the malicious behaviors over time [1,2,3].
However, RNN suffers from the vanishing gradient problem. In particular, the calculated gradients of the loss function can get very small or approach zero as they go deeper into the network. This results in minimal or no progress in training [15]. On the other hand, LSTM addresses the problem of vanishing gradients. In LSTM, each neuron comprises a memory cell, an input gate, an output gate, and a forget gate. The memory cell retains the learning values at a specific moment. These gates regulate data flow within the memory cell. The input and forget gates determine what to retain or discard. Values near to “0” should be forgotten, while values closer to “1” must be kept. Finally, the output gate selects useful information as the final output [3,16].
The concepts introduced above form the basis for recent IDS research. The following section reviews how these techniques have been applied in IoT intrusion detection and highlights the remaining gaps.
3. Related Work
Recently, deep learning-based intrusion detection systems have attracted growing interest in the IoT field. Moreover, many studies have applied transfer learning to improve detection accuracy while addressing challenges related to the constrained computational resources of IoT environments. In the following, a review of some related studies is provided.
Rodríguez et al. [8] proposed a transfer learning-based intrusion detection system that enhances the identification of zero-day attacks in IoT environments. The transfer learning model is based on the Convolutional Neural Networks (CNNs). Here, the convolutional layers were kept fixed, and their output was used as input to the classifier. For evaluation, the BoT-IoT dataset is used as the source domain, and the UNSW-NB15 dataset is used as the target domain. Three specialized datasets are extracted from the UNSW-NB15 dataset to evaluate the model based on different scenarios. In results, the proposed framework achieved an overall accuracy of 97.89%. In addition, excellent rates of detection for several categories of zero-day attacks have been reported. However, they used a target dataset that is not based on real IoT network traffic.
Similarly, the authors of [12] presented a transfer learning solution for detecting the behaviors of new attacks in the IoT. They built the original source model based on the CNNs. Then, they adapted the model to the target domain by freezing the convolutional base and utilizing its output to feed the classifier. The Bot-IoT dataset is used as a source domain. The target domain is a small data extracted from the TON-IoT dataset. Obtained results from the updated model demonstrate good detection accuracy and reduced training time. In addition, it overcomes the lack of labeled data in some classes.
A deep learning approach for IoT intrusion detection is proposed in [17]. The authors developed a model called TDL-IDS using transfer learning. The model is parameter-based transfer learning. The learned weights from the source model are reused. They first trained an LSTM model on the NSL-KDD dataset as the source domain. Then, they fine-tuned it on the AWID dataset as the target domain. Their approach demonstrated strong performance. They achieved high accuracy of around 97% compared to similar approaches.
Nandanwar and Katarya [18] introduced a deep transfer learning model called TL-BILSTM. Their model combines CNN and BiLSTM layers to detect botnet attacks in IoT environments. While they propose the use of transfer learning in theory, the testing does not involve source and target domains. However, all experiments are conducted on a single dataset. The N_BaIoT dataset was used. A high testing accuracy of 99.52% was reported.
Rabhi et al. [19] proposed a transfer learning approach to detect Mirai botnets in IoT networks. They used two deep learning models: Artificial Neural Network (ANN) and LSTM. The N-BaIoT and IoT-23 datasets were used as the source and the target domains, respectively. Transfer learning was applied by transferring the learned weights from the source model to the target model. For both algorithms, transfer learning outperformed deep learning. ANN accuracy increased from 91% to 98%. Also, LSTM improved from 96% to 99%.
In [20], Maz et al. proposed a transfer learning approach for detecting keylogging attacks in IoT networks. In the source domain, the authors trained a CNN model on the BoT-IoT dataset. Then, transfer learning was applied in the target domain using an RNN model. The Keylogger_Detection dataset was used as the target domain. The proposed model achieved an accuracy of 92.02%. Results show that transfer learning can be effective in detecting underrepresented attacks within IoT environments.
These recent studies demonstrated high accuracy in detecting attacks in IoT using different transfer learning techniques. However, the evaluation of some approaches [8,17] was conducted using non-IoT datasets. These datasets do not reflect the characteristics of IoT-specific network traffic. In addition, some studies [19,20] focused on transferring a single attack type and therefore used datasets tailored to that specific goal. In contrast, the present study examines whether temporal patterns learned from one group of attack behaviors can be adapted to distinct attack categories within the same IoT environment.
Although Rodríguez et al. [8] evaluate a larger number of attack families, their objective differs fundamentally from the present study. Their framework focuses on heterogeneous cross-dataset zero-day detection using CNN-based transfer learning. In contrast, this work deliberately constructs a controlled homogeneous intra-dataset transfer setting within BoT-IoT. The source and target domains are intentionally defined using behaviorally distinct attack families to examine whether temporal representations learned by an LSTM model can generalize and be effectively transferred to semantically different and previously unseen attack categories within the same IoT environment. This experimental design isolates the effect of partial fine-tuning and layer freezing under lightweight retraining constraints, which is the primary objective of this study.
Moreover, some proposed models were built based on CNNs [8,12]. Due to the efficiency of CNNs in extracting spatial features, these models demonstrated robust performance in detecting cyberattacks. Nonetheless, CNNs are inherently limited in their ability to capture temporal dependencies. However, analyzing temporal features can be essential in handling network traffic data. To address this limitation, other works [17,19] have adopted LSTM networks. LSTM is more suitable for modeling temporal patterns in time dependent attack behaviors. Hence, detection accuracy can be improved.
A combination of CNN and RNN layers has also been proposed in [18,20] to leverage both spatial and temporal features. An improvement in detection accuracy was reported for these hybrid models. However, they may introduce overhead in IoT systems with constrained computational resources [14].
Furthermore, some related studies have employed transfer learning with full fine-tuning, in which all layers are retrained using transferred weights. By contrast, others applied partial fine-tuning, where certain layers of the model are frozen. As demonstrated in [21], freezing more layers results in a greater reduction in computational complexity.
To bridge an important gap in current research, this work proposes a transfer learning strategy that is suitable for resource-constrained IoT devices. The approach involves freezing most of the pretrained model layers and fine-tuning only the final layers. Thus, computational overhead is reduced while efficiency is maintained. The proposed model utilizes LSTM to capture temporal features of network traffic. For evaluation, the BoT-IoT dataset is selected. This dataset includes several types of modern IoT attacks. Table 1 summarizes the design choices of related studies and highlights the key differences between existing approaches and the framework proposed in this work.
Table 1.
Related work summary.
While existing transfer learning approaches demonstrate strong detection accuracy, limited attention has been given to the practical feasibility of lightweight retraining directly on resource-constrained IoT devices. Many prior works apply full fine-tuning or hybrid architectures without explicitly analyzing the computational implications of repeated updates in dynamic IoT environments. However, real-world deployments require rapid adaptation to evolving attack behaviors while minimizing training overhead and memory usage. The present study addresses this practical gap by proposing a lightweight LSTM-based transfer learning framework that freezes recurrent layers, reduces retraining cost, and explicitly evaluates efficiency improvements alongside balanced detection performance. This design aligns with the requirement for decentralized, frequent on-device updates in realistic IoT scenarios.
4. Dataset and Preprocessing
This section presents the BoT-IoT dataset used in this study and outlines the preprocessing pipeline applied to prepare the data for model development.
4.1. BoT-IoT Dataset
This study employs the BoT-IoT dataset, created by the University of New South Wales Canberra Cyber research team [22]. The dataset was built in a controlled testbed that simulated IoT devices using Node-RED and the MQTT protocol. Several smart home services, such as sensors, lights, and thermostats, were emulated. Four Kali Linux machines launched different botnet attacks, including DDoS, DoS, Reconnaissance, and Theft. Each attack type was executed in distinct sessions and captured as independent PCAP files. Normal traffic was generated with the Ostinato tool as a background context for all attack scenarios. The dataset was labeled according to attack category and subcategory. This setup produced realistic IoT traffic that combines normal and attack flows while maintaining temporal and behavioral separation between attack families.
The dataset contains more than 73 million records and 46 features, with labeled categories and subcategories for each record. Table 2 and Table 3 summarize, respectively, the original BoT-IoT dataset composition (categories and subcategories) and its main feature set.
Table 2.
Original BoT-IoT dataset composition.
Table 3.
BoT-IoT feature set summary [22].
It is important to note that the BoT-IoT dataset exhibits a highly skewed class distribution. The volumetric DoS and DDoS traffic representing the majority of records. Other categories such as Theft and normal traffic are comparatively sparse. However, this imbalance reflects realistic IoT botnet dynamics, where large scale flooding attacks generate significantly higher traffic volumes than reconnaissance or data-exfiltration activities.
Rather than artificially balancing the dataset, we preserve the original distribution to maintain realistic traffic dynamics and avoid distorting natural temporal dependencies. Because the proposed framework relies on sliding window sequence construction and LSTM-based temporal modeling, aggressive resampling could disrupt flow continuity and short-term behavioral patterns essential for learning meaningful representations. To ensure fair evaluation, we apply imbalance handling strategies and report macro averaged metrics and balanced accuracy.
Furthermore, dataset construction quality and labeling integrity must be carefully examined. Recent studies have shown that errors in benchmark NIDS datasets can significantly distort learning outcomes. For example, ref. [23] reported labeling inconsistencies in CIC-IDS-2017 and CSE-CIC-IDS-2018 due to time based filtering and undocumented labeling logic. In contrast, the BoT-IoT dataset was generated within a controlled virtualized testbed. Attack scenarios were explicitly scheduled, packet captures were organized per attack category. Labeling was performed using known attacker and victim IP addresses combined with structured database queries [22]. However, BoT-IoT remains a synthetic benchmark dataset. Thus, residual artifacts cannot be completely excluded.
4.2. Domain Split
In this work, the dataset was divided into two subsets to promote homogeneous transfer learning. These subsets represent the source and target domains. The source domain includes all records labeled DDoS and Reconnaissance with their subcategories. The target domain includes all records labeled DoS and Theft with their subcategories. The selection was performed deterministically using the original category labels provided by the dataset creators. As described in Table 1, these attack families differ clearly in intent, traffic volume, temporal behavior, and flow structure. Therefore, the chosen split represents two behaviorally distinct knowledge domains suitable for evaluating transfer learning across semantically different attack patterns.
All normal records were intentionally reused in both domains as a common background. This duplication is reasonable and does not introduce data leakage, as the evaluation focuses on unseen attack behaviors that are entirely distinct between domains. Furthermore, this is consistent with the dataset’s original design, where the same normal traffic coexists with different attack categories. This reflects stable benign background behavior that is independent of attack type.
Table 4 outlines the structure and record distribution of the split. As can be observed, the source domain is rich and supports improved learning. In contrast, the target domain contains a scarce class, representing the typically sparse nature of real-world IoT environments. This realistic and leakage-free setup supports effective knowledge transfer and fair evaluation of adaptation to unseen attacks.
Table 4.
BoT-IoT dataset split categories distribution.
4.3. Data Preprocessing
It is necessary to apply data preprocessing procedures before model training to ensure compatibility with deep learning architectures. All preprocessing steps were performed after the domain split and independently for each domain to avoid any cross-domain influence. Raw traffic records were cleaned, converted into numeric form, and one-hot encoded. Missing values were replaced with zero. Finally, StandardScaler was used for features normalization.
4.4. Sequence Construction
A sliding-window method was used to capture temporal dependencies in network flows. First, records were grouped by their source address (saddr). This ensured that each sequence was formed exclusively from the traffic of a single device. Within each group, overlapping windows were generated while preserving the original time order. Each sequence contained 10 consecutive records. This length offered a good balance between temporal coverage and computational efficiency. Smaller windows are suitable for short-term IoT traffic changes and lightweight detection. Larger windows can add noise and increase processing cost [24,25].
Sequences overlapped with a step size of 5 records in the source domain and a step size of 1 record in the target domain. This design choice reflects the different class distributions of the two domains. The source domain is larger and more balanced, so partial overlap is efficient. The target domain contains a scarce attack, which require more coverage. Since the domains are independent, these differences do not cause transfer bias. They simply reflect the distinct data characteristics of each domain.
4.5. Dataset Splitting
Data were assigned to training, validation, and testing sets based on source address grouping. Training sequences were randomly shuffled using a fixed seed. The validation and test sets were kept in their natural temporal order. This is important to support generalization.
Specifically, groups were analyzed manually using diagnostic statistics showing the number of records and class counts per address in both domains. Based on this analysis, each group was assigned to train, validation, or test to maintain similar class proportions and approximately equal ratios in the source and target domains. The final composition follows a 50%–25%–25% ratio, with small variations caused by integer group boundaries. Moreover, the same address groups were assigned to the same split in both domains to ensure cross-domain consistency and leakage-free evaluation. Table 5 and Table 6 show the distribution of sequences and class proportions across the train, validation, and test splits in both domains. Detailed group-level statistics and split composition summaries are provided in Appendix B for transparency and reproducibility.
Table 5.
Source domain split summary.
Table 6.
Target domain split summary.
This group-aware strategy ensures zero intersection between train, validation, and test sets within each domain. As a result, the target test set used for final evaluation has no overlap with any train or validation data from either domain. Consequently, the results depend solely on unseen attack behaviors. This ensured a leakage-free, unbiased, and reliable evaluation.
5. Methodology and Implementation
This section describes the detailed design and implementation of the proposed transfer learning framework. Figure 1 illustrates the overall architecture, including both the source domain training phase and the target domain adaptation phase. In the source domain, the LSTM-based model is trained to learn temporal traffic representations. In the target domain, the pretrained model is loaded, the recurrent layers are frozen, and only the final classification layers are fine-tuned to enable lightweight adaptation.
Figure 1.
Proposed model overall architecture.
All implementations were carried out on Google Colab utilizing an NVIDIA A100 GPU with 40 GB of memory. Python 3.12.12 with TensorFlow 2.19.0 and Keras 3.10.0 were used for both training and testing. Libraries such as NumPy, pandas, and scikit-learn were employed for data processing and metric evaluation. All experiments used fixed seeds for reproducibility. The overall workflow of the implementation steps is illustrated in Figure 2. The diagram summarizes the end-to-end process, including domain splitting, preprocessing, sequence construction, and the transfer-learning step where the pretrained LSTM layer is frozen and reused for target-domain adaptation. The following subsections provide a step by step explanation of the model architecture, training configuration, and evaluation setup.
Figure 2.
Proposed model workflow.
5.1. Source Domain Model (Building and Training)
In the source domain, an LSTM-based recurrent neural network architecture was used. The architecture consists of:
- An LSTM layer with 128 units;
- A fully connected dense layer with 64 neurons and ReLU activation;
- An output layer with two neurons and softmax activation.
Here, LSTM is used to capture temporal dependencies. Then, the additional dense layers are important to learn discriminative representations that enhance class separability. Batch normalization was applied after the dense layer to stabilize activations and improve convergence.
The model was optimized using the “Adam” optimizer with a learning rate of (1 × 10−3) and gradient clipping (clipnorm = 1.0) to improve numerical stability. It was trained with the “Sparse Categorical Cross-Entropy” loss function. This function supports binary labels without one-hot encoding. Finally, the output layer performs binary classification into “normal” and “attack.”
In the source dataset, attack records dominated normal traffic in an imbalanced distribution. To mitigate this, an oversampling generator was implemented during training. The implementation details of the oversampling procedure are provided in Appendix A.
A custom validation callback was introduced to monitor precision of the minority class at each epoch. This was used to control the number of missed attacks, as higher precision of the normal class indicates fewer missed attack. On the other hand, monitoring overall accuracy can be misleading under imbalance, since it does not reflect how well the model learns the minority class.
The model was trained for up to 12 epochs with a batch size of 256. An early stopping was applied with (patience = 3) if no improvement in validation precision was observed. Additionally, a ReduceLROnPlateau scheduler was used. It adjusts the learning rate dynamically when performance stops to improve. Reducing the learning rate allows the optimizer to make finer adjustments and avoid progress stalls. This can improve stability in later stages of training. The best weights were saved according to validation performance.
The main architectural components, hyperparameters, and training settings of the source domain model are summarized in Table 7.
Table 7.
Source domain settings.
5.2. Target Domain Model (Transfer Learning)
In the target domain, transfer learning was applied. The pre-trained LSTM-based model from the source domain was reused. The same pretrained source model checkpoint was reused for all target-domain experiments to provide consistent initialization for transfer learning. The LSTM layer was frozen with non-trainable parameters. However, the dense layers were reinitialized and fine-tuned using the target dataset. A new classification head with three output neurons and softmax activation was introduced for multi-classification to distinguish Normal, DoS, and Theft traffic.
To address imbalance in the target domain, balanced class weights strategy was applied. Class weights were computed from the distribution of the training set. Each weight is inversely proportional to the frequency of each class. Then, these weights were passed during training to ensure that minority classes, such as Theft, contributed proportionally to the loss. This approach avoids bias while maintaining the full dataset.
The model was trained using the “Adam” optimizer and the “Sparse Categorical Cross-Entropy” loss function. When combined with the class weights, each sample contributes a weighted loss term of the form:
where is the true label, is the predicted probability of that class, and is the corresponding class weight. This formulation directly links the class weights strategy to the optimization objective. It increases the influence of rare classes during training. The computed class weights derived from the training set were 0.3334, 959.40, and 5011.77 for DoS, Normal, and Theft, respectively.
The same gradient clipping setting (clipnorm = 1.0) used in the source domain was applied to maintain training stability. However, the learning rate was reduced to (7 × 10−4) to enable gentler weight updates during fine-tuning. This smaller learning rate allows the pretrained model to adapt gradually to the target data without disrupting the useful representations learned from the source.
Training was performed for up to 20 epochs with a batch size of 256. A custom callback was implemented to compute the recall of the rare class “Theft” on the validation set after each epoch. This metric was selected to control the rate of missed attacks that may occur due to the limited number of rare class samples.
Early stopping (patience = 3) was applied when the validation recall of Theft stopped improving. In addition, a ReduceLROnPlateau scheduler reduced the learning rate when performance plateaued. The main architectural components, hyperparameters, and training settings of the target domain model are summarized in Table 8.
Table 8.
Target domain settings.
6. Evaluation and Results
6.1. Evaluation Metrics
The model performance and detection capability are evaluated using standard evaluation metrics, including accuracy, precision, recall, and F1-score.
Accuracy is defined as the ratio of correct predictions to the total number of predictions. Moreover, the ratio of correctly predicted positive records to all predicted positives is precision. On the other hand, recall measures the ratio of correctly predicted positive records to all actual positives. In the context of IDS, precision can be directly related to the rate of false alarms, while recall reflects the rate of missed attacks. The F1-score, which is the harmonic mean of precision and recall, is often more informative than accuracy under imbalance [26,27].
In addition, ROC-AUC and PR-AUC are reported. Unlike accuracy or F1-score, these two metrics evaluate the model at all possible thresholds between 0 and 1. ROC-AUC is based on the Receiver Operating Characteristic curve, which plots the true positive rate against the false positive rate for every threshold and then calculates the area under that curve. PR-AUC is based on the Precision-Recall curve, which plots precision against recall for every threshold. These metrics show the model’s ability to separate different classes when class imbalance exists [27,28]. In this study, these metrics can reflect the model’s ability to detect minority and rare classes.
Moreover, Balanced Accuracy (BACC) is reported to handle the problem of skewed class distribution. In such cases, high overall accuracy can easily be achieved by correctly predicting the majority classes. Conversely, BACC avoids this by calculating the average recall measured separately for each class. This will give equal weight to both majority and minority classes. Accordingly, BACC can be considered a more reliable metric when the dataset is imbalanced [29].
Additionally, Matthews Correlation Coefficient (MCC) is also reported. MCC is calculated using all four entries of the confusion matrix: true positives, true negatives, false positives, and false negatives. It produces a score between −1 and +1, where +1 represents perfect prediction, 0 indicates random prediction, and −1 indicates total disagreement between predictions and true labels. Because it evaluates the quality of predictions across both majority and minority classes at once, MCC is widely recognized as a reliable metric under imbalance [29].
Finally, different averaging methods can be applied. As shown in Table 9, both micro and weighted averages favor the majority class, while the macro average gives equal importance to both frequent and rare classes [30]. Because the dataset in this study is unbalanced, the macro average was selected as the most representative option to ensure that minority classes are not overshadowed. All macro results reported in this work refer to unweighted macro averages, calculated as the simple mean of per-class scores without considering class frequency. The formulas for all discussed metrics are summarized in Table 9.
Table 9.
Evaluation metrics summary.
6.2. Source Domain (Binary Classification)
In the source domain, the model was trained using binary classification. Oversampling of the minority class was applied. The results are summarized in Table 10. The model achieved consistently well-balanced performance across all evaluation metrics. Overall accuracy reached 99.99%, with ROC AUC of 0.99 and balanced accuracy of 0.96. The minority class achieved an F1-score of 0.94, reflecting balanced precision and recall. These results indicate that the oversampling strategy was effective. The normal traffic detection remained stable despite the highly imbalanced distribution. Furthermore, the MCC of 0.93 demonstrates that the model performed reliably across both majority and minority classes.
Table 10.
Source domain results.
The confusion matrix in Figure 3 illustrates that only a few normal samples were misclassified as attacks. Also, almost all attack instances were correctly detected. These results indicate that the source model can provide a reliable baseline for transfer learning in intrusion detection.
Figure 3.
Sourcedomain confusion matrix (raw counts).
Furthermore, we conducted a per-class analysis on the source domain test set which consists of two distinct attack categories: DDoS and Reconnaissance. The results show that DDoS achieved extremely high detection performance, with only 8 missed attack sequences out of 1,918,569 samples. Reconnaissance also demonstrated high detection accuracy (0.9997), with only 13 missed attack sequences out of 94,546 samples. The small performance difference between DDoS and Reconnaissance is consistent with their relative sample sizes and variability. These findings confirm that the learned temporal representations generalize effectively across different attack behaviors within the source domain.
6.3. Target Domain (Multi-Class Classification)
In the target domain, the source model was transferred and adapted to classify DoS, Normal, and Theft. Balanced class weights was used for imbalance-handling. The results are summarized in Table 11. The model achieved an overall accuracy of 99.99%, a macro F1 of 0.96, and a macro recall of 0.98, showing strong detection of the rare “Theft” class with an F1-score of 0.93.
Table 11.
Target domain results.
The near perfect performance observed for DoS can be attributed to its dominant representation and highly consistent volumetric traffic patterns, which are easier to capture through temporal modeling. In contrast, the Normal and particularly the Theft class are significantly underrepresented in the dataset. Despite this severe imbalance, the performance gap remains limited, with minority class F1-scores remaining above 0.93. This indicates that the proposed imbalance handling strategy and transfer learning framework preserve balanced detection capability rather than overfitting to the majority class.
In addition, the model achieved ROC-AUC values of 0.99, 0.98, and 0.98 for DoS, Normal, and Theft, respectively. The corresponding PR-AUC values were 1.00 for DoS, 0.92 for Normal, and 0.88 for Theft. These results demonstrate robust class discrimination and balanced precision–recall performance, particularly for the rare Theft attack.
The confusion matrix in Figure 4 confirms that the model produced only a few false negatives (missed attacks). Some false positives (normal traffic misclassified as attacks) were also observed. The False Positive Rate (FPR) was approximately 6 alerts per million events. This is a very low alarm frequency and is practical for real IoT intrusion-detection scenarios. Smart-home deployments typically generate modest daily traffic, usually tens of thousands of events, and even busy homes rarely exceed a few hundred thousand. This is consistent with real measurement studies of residential IoT environments [31]. Under these conditions, our FPR corresponds to zero to one false alert per day, which is too low to cause alert fatigue or disrupt normal device activity.
Figure 4.
Target domain confusion matrix (raw counts).
6.4. Baseline and Efficiency Comparison
A baseline model was trained directly on the target dataset using the same preprocessing and class weights setup but without transfer learning. This setup isolates the effect of transfer learning while keeping all other conditions identical.
As shown in Table 12, training from scratch required 90 min, while the transfer learning model with a frozen LSTM finished in 47 min. This represents a 47.8% reduction in training time, about 1.91× faster. Despite the shorter training, the transfer learning model achieved better results: macro-F1 increased from 0.90 to 0.96, and balanced accuracy improved from 0.89 to 0.98. For the rare Theft class, recall rose from 0.71 to 0.96, showing that pretrained temporal features enhanced minority attack detection.
Table 12.
Baseline and transfer learning efficiency comparison in the target domain.
The LSTM-based architecture contains 96,259 total parameters. Freezing the LSTM layer reduced the trainable parameters to 8579, representing a 91.1% reduction. This significantly lowers computational cost and memory usage while improving efficiency. As a result, the transfer learning model achieved a higher training throughput, processing approximately 27,517 samples per second compared to 22,499 samples per second for training from scratch. The improvement reflects more efficient GPU utilization and reduced computational overhead due to the smaller number of trainable parameters.
These results show that transfer learning improves accuracy and recall while making retraining for periodic updates feasible on resource-limited edge devices. A detailed analysis of CPU-based inference efficiency is provided in Appendix C. The measured model size (<0.5 MB) and sub-millisecond latency () demonstrate that the framework remains computationally lightweight during deployment.
6.5. Macro-Averaged Results Analysis
The macro-averaged results of all reported experiments are summarized in Table 13. These values provide a comprehensive view of performance regardless of class distribution.
Table 13.
Macro-averaged results across all experiments.
For the source domain, the model achieved a macro precision, recall, and F1-score of 0.97. In addition, macro ROC-AUC and macro PR-AUC were both above 0.99. These excellent values demonstrate that the source model can be highly reliable even under extreme imbalance.
In the target domain with transfer learning, the macro F1 reached 0.96 with a macro recall of 0.98, indicating that the model maintained a strong balance between precision and recall. When training from scratch without transfer learning, the macro F1 dropped to 0.90 and macro recall to 0.89, showing that pretraining significantly improved generalization and stability. In conclusion, transfer learning combined with imbalance-handling enabled reliable multi-class performance. Particularly, rare attacks were effectively detected without compromising majority-class performance.
6.6. Non-Overlapping Test Evaluation (Robustness Check)
Overlapping sequences may artificially inflate evaluation metrics. To verify this effect, an additional experiment was conducted using non-overlapping windows (step = 10) applied to the original test split. This setting produced a total of 824,305 sequences, comprising 824,071 DoS, 208 Normal, and 26 Theft samples. The results were highly consistent with those of the main experiment, achieving an accuracy of 99.9%, a macro F1-score of 0.95, balanced accuracy of 0.98, and an MCC of 0.95. These values differed by less than 1% from the overlapping-window results. Per-class F1-scores for DoS (1.00), Normal (0.94), and Theft (0.91) also remained stable.
The confusion matrix in Figure 5 confirms that the model maintained strong recall for the rare Theft class while keeping false-positive rates negligible. These findings confirm that window overlap had no measurable impact on evaluation results. The model’s performance remains reliable and consistent across different test configurations.
Figure 5.
Non-overlappingtest confusion matrix (raw counts).
6.7. Multi-Seed Evaluation and Reproducibility
To verify the stability of the proposed transfer learning configuration, the target domain experiment was repeated using four additional random seeds while keeping all other parameters identical.
Table 14 summarizes the macro-averaged results across five independent runs. All metrics show very small variations, indicating that the model’s performance is not driven by randomness but by consistent learning behavior. Macro F1, precision, and recall remained highly stable (), and both ROC-AUC and PR-AUC varied by less than 0.012 across all runs. Training time and throughput were also consistent, confirming reproducible efficiency on the same hardware. These results demonstrate that the model exhibits strong robustness and reproducibility under different random initializations.
Table 14.
Multi-seed reproducibility of the target domain.
7. Discussion
The proposed transfer learning model demonstrated strong performance in both source and target domains. Suggested methods for handling imbalance enabled reliable detection even under extreme imbalance. Importantly, the model trade-off favored recall over precision. Thus, minimizing missed attacks is more critical than reducing false alarms in IDS. False alarms can be filtered, but missed attacks may cause severe damage.
Previous works have applied transfer learning to IoT intrusion detection using different architectural choices and transfer objectives. Both refs. [18,20] adopt hybrid CNN–RNN architectures, employing alternative feature extraction strategies and higher architectural complexity.
In contrast, the models proposed in [17,19] demonstrate the feasibility of LSTM-only transfer learning. However, the use of non-IoT datasets in [17] makes direct comparison challenging. These datasets do not reflect the distribution and imbalance characteristics of IoT-specific traffic such as BoT-IoT. Moreover, the study in [19] focuses on generalizing a specific attack type across different datasets or environments. Similarly, in [20], the transfer learning objective is to adapt previously learned representations of the same attack behavior to a new dataset with limited labeled data.
By comparison, the proposed work addresses homogeneous intra-dataset transfer, with an emphasis on retraining feasibility on edge devices. Knowledge is reused to adapt to distinct and previously unseen attack types within the same dataset, including rare classes.
Accordingly, result comparisons are restricted to LSTM-based approaches, particularly [17,19], which are the most architecturally aligned references. Although the datasets and transfer settings differ, these studies provide the closest available context for interpreting the impact of the proposed transfer learning strategy. Table 15 summarizes the differences in experimental setup and performance.
Table 15.
Results comparison with LSTM-based transfer learning works.
Previous LSTM-based transfer learning studies processed individual records without temporal sequencing. Conversely, this work explicitly models short-term temporal dependencies using fixed 10-step sliding windows. This distinction enables the model to exploit temporal context and improve detection performance.
Moreover, ref. [19] evaluated a binary task, whereas ref. [17] and the proposed work used multi-class setups. In prior studies, F1 was either not reported or reported without specifying the averaging method. In contrast, this study explicitly reports Macro-F1, which averages per-class results to better reflect performance under class imbalance.
In addition, an important distinction can be made based on training strategy. These works performed full fine-tuning of all model layers on the target domain, which can improve accuracy but results in heavier models. Full fine-tuning requires more computational resources and may restrict retraining to centralized servers or cloud infrastructure. By contrast, the proposed approach froze the LSTM layers and fine-tuned only the dense layers. This lightweight strategy reduced training cost by reusing source-domain knowledge while adapting to target data.
Furthermore, freezing layers may provide critical benefits in the context of IoT deployment. For example, Kolcun et al. [21] showed that freezing one to three layers in LSTM-based models reduced training time by more than 50% while maintaining high accuracy. Therefore, retraining can be done directly on edge devices rather than in the cloud. This approach can enable more frequent updates without overloading constrained devices. In addition, it avoids the need to transfer sensitive IoT data to a centralized cloud for enhanced privacy. Accordingly, transfer learning with partial layer freezing can optimize training under the strict memory, energy, and computation limits of IoT edge nodes [5]. Conversely, models that require full fine-tuning may not meet the IoT requirements of rapid adaptation and decentralized updates.
Moreover, it is important to discuss the risk of overfitting when applying oversampling under severe class imbalance. In this study, oversampling was applied exclusively within the training set of the source domain and was implemented at the batch level using sampling with replacement, without modifying validation or test distributions. In addition, the group-aware splitting strategy ensured zero overlap between training, validation, and test address groups. This eliminates data leakage across splits.
Importantly, the reported performance is not based solely on overall accuracy, which can be misleading under imbalance, but also on balanced accuracy, macro-F1, PR-AUC, and Matthews Correlation Coefficient (MCC). The strong agreement across these imbalance-sensitive metrics suggests that the model does not simply memorize replicated minority instances. Furthermore, the stability of results under non-overlapping test evaluation (Section 6.6) and across multiple random seeds (Section 6.7) indicates consistent generalization behavior. Taken together, these methodological safeguards and robustness analyses mitigate the likelihood of overfitting induced by the oversampling strategy.
Additionally, an important practical consideration for IoT deployment is concept drift, where traffic patterns and attack behaviors evolve over time. Although this study evaluates a static intra-dataset transfer setup, the proposed pipeline aligns well with drift-handling strategies. Freezing the recurrent layers reduces the cost of repeated fine-tuning. In dynamic IoT environments, the transferred model can be periodically refreshed using small amounts of recent data while still retaining stable temporal representations in the frozen layers. Common monitoring practices, such as observing drops in validation accuracy or F1-score, can indicate when the model’s performance begins to degrade. When this occurs, a lightweight update involving only the dense layers can be triggered [5,32].
It is important to note that the proposed transfer strategy deliberately freezes the recurrent layers to reduce training cost and support retraining feasibility on resource-constrained devices. While this design choice is advantageous in homogeneous transfer scenarios, it may limit adaptability under heterogeneous conditions compared to full fine-tuning approaches.
In cross-dataset scenarios, the feature space may differ substantially due to variations in traffic generation processes, preprocessing pipelines, or monitoring tools. Also, datasets collected in different environments often exhibit different attack taxonomies, network conditions, traffic intensity, and IoT device characteristics. These factors can alter the representations and temporal dependencies learned in the source domain. This mismatch can lead to degraded detection performance. Deeper layers often need to adjust to new feature distributions and traffic dynamics. In such cases, additional mechanisms are required including domain adaptation techniques, feature-space alignment, or selective layer unfreezing, which are well established in the transfer learning literature and are left for future work [10,11].
Beyond cross-dataset variability, broader cross-domain deployment may introduce additional challenges. Although the framework is not inherently tied to a specific protocol, its validation is limited to a single IoT dataset with flow level features. In contrast, domains such as C-V2X rely on physical layer characteristics and graph-based temporal modeling rather than traffic flow representations [33]. Such differences in feature semantics and signal dynamics may further amplify distribution shifts. In these heterogeneous scenarios, full fine-tuning of the feature extractor could be required to maintain performance, at the expense of the lightweight retraining advantage emphasized in this work. Therefore, cross-domain validation and the trade-off between computational efficiency and broader adaptability remain future research directions.
In conclusion, the proposed methodology provides a lightweight solution that enables periodic model updates on edge devices within the same environment. The results demonstrate performance comparable to state-of-the-art LSTM-based transfer learning approaches for IoT intrusion detection.
7.1. Supervised Transfer Learning vs. Anomaly Detection
An alternative paradigm for intrusion detection in IoT environments is anomaly detection. These models are trained primarily on normal traffic and then detect deviations as potential attacks [13,14]. Such approaches can reduce reliance on labeled attack data. However, they can be sensitive to concept drift which is a well known challenge in real deployments [32].
Prior work in IoT anomaly detection notes that previously trained anomaly detection models may fail to adapt to changed streaming distributions. This results in many false-positive events [34]. When labeled data are available, supervised models can achieve stronger classification performance than unsupervised alternatives in comparative IDS studies [35].
Therefore, the proposed supervised transfer learning approach is most suitable when at least some labeled attack data exist in related deployments. On the other hand, anomaly detection may be preferable in fully unsupervised or privacy restricted settings. A direct empirical comparison is left for future work.
7.2. Limitations and Future Work
This study focused on a controlled intra-dataset transfer setup using the BoT-IoT dataset. The experiments showed stable results across multiple random seeds and provided a realistic simulation of IoT conditions. However, while these results demonstrate effective adaptation within a homogeneous setting, extending the evaluation to cross-dataset validation is a prerequisite for making broader claims about generalizability to real-world IoT deployments. Furthermore, exploring cross-domain scenarios involving fundamentally different network paradigms would be an interesting direction for future investigation.
In addition, the effect of sequence overlap was examined separately using a non-overlapping test configuration and yielded consistent results. Nevertheless, a comprehensive sensitivity analysis of hyperparameters and model depth remains an important direction for future investigation.
Moreover, this study does not include a direct empirical comparison with unsupervised anomaly detection methods. The proposed framework operates within a supervised transfer learning setting and evaluates adaptation to previously unseen but labeled attack families within the same feature space. It does not address strict zero-day detection in which entirely unknown attack behaviors must be identified without labeled examples. Although supervised transfer learning offers advantages when limited labeled data are available for emerging threats, detecting completely novel attacks would require anomaly based or continual learning approaches. Evaluating such alternatives would provide further insight into deployment trade offs in real-world IoT systems and remains an important direction for future work.
Looking ahead, future work will explore hybrid CNN–RNN architectures to balance temporal modeling with computational efficiency. Further extensions will address concept drift and the detection of novel attack behaviors beyond those represented in BoT-IoT. This will enable a more thorough assessment of scalability, robustness, and adaptability across diverse IoT datasets and deployment conditions.
8. Conclusions
This paper proposed a lightweight intrusion detection model for IoT environments using homogeneous transfer learning. It offers an application-oriented evaluation of a practical pipeline tailored for efficient adaptation in IoT settings. The proposed model uses LSTM layers to capture short-term temporal patterns in network traffic. It adapts efficiently to limited data in the target domain.
The experimental setup was designed to reflect realistic IoT conditions through intra-dataset transfer, using disjoint attack families and realistic class imbalance. The results confirmed that the proposed model achieves high accuracy and balanced performance, even for scarce attack classes such as Theft. Imbalance handling based on oversampling and balanced class weights maintained stable recall and precision. Fixed seeds and group-aware splits ensured reproducibility and zero data leakage. By freezing layers during transfer learning, the number of trainable parameters was reduced by approximately 91%, while the macro F1-score improved to 0.96. These results demonstrate that the model can be efficiently deployed and retrained on resource-constrained edge devices.
Author Contributions
Conceptualization, A.G.; methodology, A.G.; software, A.G.; validation, A.G.; formal analysis, A.G.; investigation, A.G.; resources, A.G.; data curation, A.G.; writing—original draft preparation, A.G.; writing—review and editing, S.S. and R.M.; visualization, A.G.; supervision, S.S. and R.M. All authors have read and agreed to the published version of the manuscript.
Funding
The article processing charge (APC) was supported by KAU Endowment (WAQF) at King Abdulaziz University, Jeddah, Saudi Arabia.
Data Availability Statement
The Bot-IoT dataset used in this study is publicly available at the UNSW Canberra Cyber Centre: https://research.unsw.edu.au/projects/bot-iot-dataset, accessed on 2 March 2026. No new data were created in this study. The implementation code developed for this work is part of the author’s ongoing PhD research and is therefore not publicly available at this stage. However, it is available upon reasonable request through the corresponding author’s institutional email to ensure controlled and appropriate distribution.
Acknowledgments
The project was funded by KAU Endowment (WAQF) at king Abdulaziz University, Jeddah, Saudi Arabia. The authors, therefore, acknowledge with thanks WAQF and the Deanship of Scientific Research (DSR) for technical and financial support.
Conflicts of Interest
The authors declare no conflict of interest.
Appendix A. Pseudocode for the Oversampling Procedure
This appendix presents a pseudocode block that describe the oversampling procedure implemented for handling data imbalance in the source domain dataset. Specifically, each batch of size 256 was constructed to include approximately 27% of minority-class (normal) samples. However, the number of minority records is small compared to the majority records. Accordingly, samples were drawn with replacement. This setup allows the same record to be used in different batches across epochs. This ensured that every batch could consistently reach the desired fraction of normal samples. The remainder of each batch was filled with majority-class records without replacement.
| Algorithm A1 Oversampling Batch Generator |
|
Appendix B. Group-Wise Class Composition in Source and Target Domains
The following table lists the final IPv4 address groups that produced valid sequences and were included in both domains. Each group appears under its assigned split (train, validation, or test) as determined by the manual group-aware splitting procedure described in Section 4.5.
For each group, the table reports the number of sequences per class in the source and target domains, confirming that group membership and labeling were consistent across domains and that no group overlaps between splits.
Table A1.
Group-wise class distribution in Source and Target Domains.
Appendix C. CPU Inference Efficiency
To estimate real-world performance on standard processors, the trained model was converted to a lightweight TensorFlow Lite (float32) version and executed on the CPU (batch = 1). A single dummy input sequence with the same shape as the real data (10 timesteps × 42 features) was used to measure processing speed and memory usage.
The test reports the median and 95th-percentile latency per sequence (p50 and p95), the average throughput, and the model size. The model occupies less than 0.5 MB of storage, confirming its suitability for deployment on ordinary or low-power devices. The measured latency and throughput indicate that the proposed model supports real-time inference without GPU acceleration.
Table A2.
CPU-based TensorFlow Lite (float32) inference performance.
Overall, the measurements confirm that the model does not introduce additional computational overhead compared to conventional LSTM architectures. Its compact size and sub-millisecond inference latency make it suitable for deployment on resource-constrained IoT edge devices.
References
- Lee, S.W.; Sidqi, H.M.; Mohammadi, M.; Rashidi, S.; Rahmani, A.M.; Masdari, M.; Hosseinzadeh, M. Towards Secure Intrusion Detection Systems Using Deep Learning Techniques: Comprehensive Analysis and Review. J. Netw. Comput. Appl. 2021, 187, 103111. [Google Scholar] [CrossRef] [Scilit]
- Aldweesh, A.; Derhab, A.; Emam, A.Z. Deep Learning Approaches for Anomaly-Based Intrusion Detection Systems: A Survey, Taxonomy, and Open Issues. Knowl. Based Syst. 2020, 189, 105–124. [Google Scholar] [CrossRef] [Scilit]
- Lakshmanna, K.; Kaluri, R.; Gundluru, N.; Alzamil, Z.S.; Rajput, D.S.; Khan, A.A.; Haq, M.A.; Alhussen, A. A Review on Deep Learning Techniques for IoT Data. Electronics 2022, 11, 1604. [Google Scholar] [CrossRef] [Scilit]
- Zhuang, F.; Qi, Z.; Duan, K.; Xi, D.; Zhu, Y.; Zhu, H.; Xiong, H.; He, Q. A Comprehensive Survey on Transfer Learning. In Proceedings of the IEEE; IEEE: Piscataway, NJ, USA, 2021; Volume 109, pp. 43–76. [Google Scholar] [CrossRef] [Scilit]
- Khouas, A.R.; Bouadjenek, M.R.; Hacid, H.; Aryal, S. Training Machine Learning Models at the Edge: A Survey. arXiv 2024, arXiv:2403.02619. [Google Scholar] [CrossRef] [Scilit]
- Gyamfi, E.; Jurcut, A. Intrusion Detection in Internet of Things Systems: A Review on Design Approaches Leveraging Multi-Access Edge Computing, Machine Learning, and Datasets. Sensors 2022, 22, 3744. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Alrayes, F.S.; Amin, S.U.; Hakami, N. An Adaptive Framework for Intrusion Detection in IoT Security Using MAML (Model-Agnostic Meta-Learning). Sensors 2025, 25, 2487. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Rodríguez, E.; Valls, P.; Otero, B.; Costa, J.J.; Verdú, J.; Pajuelo, M.A.; Canal, R. Transfer-Learning-Based Intrusion Detection Framework in IoT Networks. Sensors 2022, 22, 5621. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Mehedi, S.T.; Anwar, A.; Rahman, Z.; Ahmed, K.; Islam, R. Dependable Intrusion Detection System for IoT: A Deep Transfer Learning-based Approach. In IEEE Transactions on Industrial Informatics; IEEE: Piscataway, NJ, USA, 2022. [Google Scholar] [CrossRef] [Scilit]
- Weiss, K.; Khoshgoftaar, T.M.; Wang, D.D. A Survey of Transfer Learning. J. Big Data 2016, 3, 9. [Google Scholar] [CrossRef] [Scilit]
- Pan, S.J.; Yang, Q. A Survey on Transfer Learning. IEEE Trans. Knowl. Data Eng. 2010, 22, 1345–1359. [Google Scholar] [CrossRef] [Scilit]
- Idrissi, I.; Azizi, M.; Moussaoui, O. Accelerating the Update of a DL-based IDS for IoT using Deep Transfer Learning. Indones. J. Electr. Eng. Comput. Sci. 2021, 23, 1059–1067. [Google Scholar] [CrossRef] [Scilit]
- Laskov, P.; Düssel, P.; Schäfer, C.; Rieck, K. Learning Intrusion Detection: Supervised or Unsupervised? In Proceedings of the Image Analysis and Processing—ICIAP 2005; Fabioand, R., Sergio, V., Eds.; Springer: Berlin/Heidelberg, Gemany, 2005; pp. 50–57. [Google Scholar] [CrossRef] [Scilit]
- Alsoufi, M.A.; Razak, S.; Siraj, M.M.; Nafea, I.; Ghaleb, F.A.; Saeed, F.; Nasser, M. Anomaly-Based Intrusion Detection Systems in IoT Using Deep Learning: A Systematic Literature Review. Appl. Sci. 2021, 11, 8383. [Google Scholar] [CrossRef] [Scilit]
- Pascanu, R.; Mikolov, T.; Bengio, Y. On the Difficulty of Training Recurrent Neural Networks. In Proceedings of the the 30th International Conference on Machine Learning (ICML 2013); PMLR: Cambridge MA, USA, 2013; pp. 1310–1318. [Google Scholar]
- Alimi, K.O.A.; Ouahada, K.; Abu-Mahfouz, A.M.; Rimer, S.; Alimi, O.A. Refined LSTM Based Intrusion Detection for Denial-of-Service Attack in Internet of Things. J. Sens. Actuator Netw. 2022, 11, 32. [Google Scholar] [CrossRef] [Scilit]
- Sun, X.; Meng, W.; Chiu, W.Y.; Lampe, B. TDL-IDS: Towards A Transfer Deep Learning based Intrusion Detection System. In Proceedings of the IEEE Global Communications Conference, GLOBECOM, Rio de Janeiro, Brazil, 4–8 December 2022; IEEE: Piscataway, NJ, USA, 2022; pp. 2603–2608. [Google Scholar] [CrossRef] [Scilit]
- Nandanwar, H.; Katarya, R. TL-BILSTM IoT: Transfer Learning Model for Prediction of Intrusion Detection System in IoT environment. Int. J. Inf. Secur. 2024, 23, 1251–1277. [Google Scholar] [CrossRef] [Scilit]
- Rabhi, S.; Abbes, T.; Zarai, F. Transfer Learning-based Mirai Botnet Detection in IoT Networks. In Proceedings of the 17th International Conference on INnovations in Intelligent SysTems and Applications, INISTA 2023, Hammamet, Tunisia, 20–23 September 2023; IEEE: Piscataway, NJ, USA, 2023. [Google Scholar] [CrossRef] [Scilit]
- Maz, Y.A.; Anbar, M.; Manickam, S.; Abualhaj, M.M. Transfer Learning Approach for Detecting Keylogging Attack on the Internet of Things. In Proceedings of the 4th International Conference on Emerging Smart Technologies and Applications, eSmarTA 2024, Sana’a, Yemen, 6–7 August 2024; IEEE: Piscataway, NJ, USA, 2024. [Google Scholar] [CrossRef] [Scilit]
- Kolcun, R.; Popescu, D.A.; Safronov, V.; Yadav, P.; Mandalari, A.M.; Xie, Y.; Mortier, R.; Haddadi, H. The Case for Retraining of ML Models for IoT Device Identification at the Edge. arXiv 2020, arXiv:2011.08605. [Google Scholar] [CrossRef] [Scilit]
- Koroniotis, N.; Moustafa, N.; Sitnikova, E.; Turnbull, B. Towards the Development of Realistic Botnet Dataset in the Internet of Things for Network Forensic Analytics: Bot-IoT Dataset. Future Gener. Comput. Syst. 2019, 100, 779–796. [Google Scholar] [CrossRef] [Scilit]
- Liu, L.; Engelen, G.; Lynar, T.; Essam, D.; Joosen, W. Error Prevalence in NIDS datasets: A Case Study on CIC-IDS-2017 and CSE-CIC-IDS-2018. In Proceedings of the 2022 IEEE Conference on Communications and Network Security, CNS 2022, Austin, TX, USA, 3–5 October 2022; IEEE: Piscataway, NJ, USA, 2022; pp. 254–263. [Google Scholar] [CrossRef] [Scilit]
- Murthy, A.; Asghar, M.R.; Tu, W. A lightweight Intrusion Detection for Internet of Things-based Smart Buildings. Secur. Priv. 2024, 7, e386. [Google Scholar] [CrossRef] [Scilit]
- Li, D.; Deng, L.; Lee, M.; Wang, H. IoT Data Feature Extraction and Intrusion Detection System for Smart Cities based on Deep Migration Learning. Int. J. Inf. Manag. 2019, 49, 533–545. [Google Scholar] [CrossRef] [Scilit]
- Ge, M.; Syed, N.F.; Fu, X.; Baig, Z.; Robles-Kelly, A. Towards a Deep Learning-Driven Intrusion Detection Approach for Internet of Things. Comput. Netw. 2021, 186, 107784. [Google Scholar] [CrossRef] [Scilit]
- Rahman, M.M.; Shakil, S.A.; Mustakim, M.R. A Survey on Intrusion Detection System in IoT Networks. Comput. Stand. Interfaces 2025, 3, 100082. [Google Scholar] [CrossRef] [Scilit]
- Becerra-Suarez, F.L.; Tuesta-Monteza, V.A.; Mejia-Cabrera, H.I.; Arcila-Diaz, J. Performance Evaluation of Deep Learning Models for Classifying Cybersecurity Attacks in IoT Networks. Informatics 2024, 11, 32. [Google Scholar] [CrossRef] [Scilit]
- Iturbe-Araya, J.I.; Rifà-Pous, H. Hyperparameter Optimization and Evaluation Metrics for Unsupervised Anomaly-Based Cyberattack Detection in Imbalanced Smart Home Datasets. J. Netw. Syst. Manag. 2025, 33, 99. [Google Scholar] [CrossRef] [Scilit]
- Adewole, K.S.; Jacobsson, A.; Davidsson, P. Intrusion Detection Framework for Internet of Things with Rule Induction for Model Explanation. Sensors 2025, 25, 1845. [Google Scholar] [CrossRef] [Scilit]
- Sivanathan, A.; Gharakheili, H.H.; Loi, F.; Radford, A.; Wijenayake, C.; Vishwanath, A.; Sivaraman, V. Classifying IoT Devices in Smart Environments Using Network Traffic Characteristics. IEEE Trans. Mob. Comput. 2019, 18, 1745–1759. [Google Scholar] [CrossRef] [Scilit]
- Gama, J.; Žliobaitė, I.; Bifet, A.; Pechenizkiy, M.; Bouchachia, A. A Survey on Concept Drift Adaptation. Acm Comput. Surv. 2014, 46, 1–37. [Google Scholar] [CrossRef] [Scilit]
- Greco, D.; Sohail, M.S.; Marchese, M. Detection of C-V2X Spoofing Attacks using Physical Layer Features and Graph Neural Networks. In Proceedings of the the 2025 IEEE International Conference on Cyber Security and Resilience, CSR 2025, Chania, Greece, 4–6 August 2025; IEEE: Piscataway, NJ, USA, 2025; pp. 801–806. [Google Scholar] [CrossRef] [Scilit]
- Xu, L.; Han, Z.; Zhao, D.; Li, X.; Yu, F.; Chen, C. Addressing Concept Drift in IoT Anomaly Detection: Drift Detection, Interpretation, and Adaptation. IEEE Trans. Sustain. Comput. 2024, 9, 913–924. [Google Scholar] [CrossRef] [Scilit]
- Khoei, T.T.; Kaabouch, N. A Comparative Analysis of Supervised and Unsupervised Models for Detecting Attacks on the Intrusion Detection Systems. Information 2023, 14, 103. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.




