Intrusion detection in Internet of Things (IoT) environments is challenged by severe class imbalance, evolving attack patterns, and the limited computational resources of edge devices. To address these challenges, this paper proposes a lightweight transfer-learning framework based on a combined architecture of Convolutional Neural Network and Gated Recurrent Unit (CNN–GRU) for IoT intrusion detection. The model is first pretrained on a large-scale source dataset containing mixed benign and attack traffic, then adapted to a smaller and structurally different target dataset using partial finetuning. To enable efficient edge adaptation, early convolutional layers are frozen while only the GRU and classification head are updated on the target domain. A leakage-free, group-aware data preparation strategy with overlapping temporal windows is employed to ensure reliable evaluation. Experimental results demonstrate that the proposed lightweight transfer approach achieves solid macro-level detection performance while reducing training cost compared to full finetuning. Additional analysis using a CPU-based inference proxy shows low latency and a small model footprint. This supports the feasibility of edge deployment. The results confirm that lightweight transfer learning offers an effective balance between detection performance and adaptation efficiency for resource-constrained IoT intrusion detection systems.
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.