Transfer-Learning-Based Intrusion Detection Framework in IoT Networks
Abstract
:1. Introduction
- First, we propose a novel framework for the detection of known and zero-day attacks in IoT networks, based on TL and network fine-tuning.
- Second, we propose the creation of three specialized datasets to train and evaluate the framework: (i) the UNSW-NB15-Basic, with normal traffic and four different types of known attacks; (ii) the UNSW-NB15-Test+, with normal traffic and five different types of zero-day attacks; and (iii) the UNSW-NB15-Test, with normal traffic and nine different types of attacks (four known and five zero-day attacks).
2. Related Work
3. Background
3.1. Convolutional Neural Networks
3.2. Transfer Learning
4. TL-Based Intrusion Detection Framework
- Stage 1: Source domain dataset preprocessing.
- Stage 2: Source domain learning (CNN-B training—source dataset).
- Stage 3: Target domain dataset preprocessing.
- Stage 4: Transfer learning to the target domain (CNN-TL training—target dataset).
- Stage 5: Attack detection (target dataset).
4.1. Data Treatment and Preprocessing
- One hot encoding (OHE) transformation: Transforms nominal fields to numeric using the OHE method.
- Decimal conversion: Converts hexadecimal fields to decimal format.
- Logarithmic method: Applies logarithm procedure to features with values concentrated in 0.
- Standardization: Standard normalization of the dataset to prevent model overfitting and biased results.
- Image transformation: Converts raw data to image format.
4.2. Transfer Learning
4.3. Training Phase—Source Domain
4.4. Transfer Learning Phase
5. Evaluation
5.1. Source Domain Dataset
5.2. Target Domain Dataset
- UNSW-NB15-Basic: Dataset with normal traffic and four different types of known attacks (generic, exploits, DoS, and reconnaissance) used for training. It is divided into two:
- –
- UNSW-NB15-Basic-Train: Dataset to train the initial model.
- –
- UNSW-NB15-Basic-Test: Dataset to evaluate the effectiveness in the detection of known attacks (generic, exploits, DoS, and reconnaissance).
- UNSW-NB15-Test+: Dataset to evaluate the effectiveness in the detection of zero-day attacks (fuzzers, analysis, backdoor, shellcode, and worms).
- UNSW-NB15-Test: Dataset to evaluate the effectiveness in the detection of known and zero-day attacks (generic, exploits, DoS, reconnaissance, fuzzers, analysis, backdoor, shellcode, and worms).
5.3. Data Treatment and Preprocessing
5.4. Transfer Learning
6. Results
6.1. Metrics
6.1.1. System Setup
6.1.2. Training
6.1.3. Validation
7. Conclusions and Future Work
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
ACC | Accuracy |
ACCS | Australian Center for Cyber Security |
BiT | Big Transfer |
CNN | Convolutional Neural Network |
CV | Computer Vision |
DDoS | Distributed Denial of Service |
DoS | Denial of Service |
DL | Deep Learning |
DNN | Deep Neural Network |
DR | Detection Rate |
FN | False Negative |
FP | False Positive |
FPR | False Prediction Rate |
HTTP | Hypertext Transfer Protocol |
ID | Intrusion Detection |
IDS | Intrusion Detection System |
IoT | Internet of Things |
IoV | Internet of vehicles |
MITM | Man-in-the-Middle |
ML | Machine Learning |
NLP | Natural Language Processing |
p | Precision |
r | Recall |
R2L | Remote-to-Local |
TCP | Transfer Control Protocol |
TL | Transfer Learning |
TN | True Negative |
TP | True Positive |
UDP | Datagram Protocol |
XSS | Cross-Site Scripting |
References
- Internet Security Report. Available online: https://www.watchguard.com/wgrd-resource-center/security-report-q3-2020 (accessed on 27 May 2022).
- Alladi, T.; Chamola, V.; Sikdar, B.; Choo, K. Consumer IoT: Security Vulnerability Case Studies and Solutions. IEEE Consum. Electron. Mag. 2020, 2, 17–25. [Google Scholar] [CrossRef]
- Kilincer, I.; Ertam, F.; Sengur, A. Machine learning methods for cyber security intrusion detection: Datasets and comparative study. Comput. Netw. 2021, 188, 107840. [Google Scholar] [CrossRef]
- Fadlullah, Z.M.; Tang, F.; Mao, B.; Kato, N.; Akashi, O.; Inoue, T.; Mizutani, K. State-of-the-art deep learning: Evolving machine intelligence toward tomorrow’s intelligent network traffic control systems. IEEE Commun. Surv. Tutor. 2017, 19, 2432–2455. [Google Scholar] [CrossRef]
- Thamilarasu, G.; Chawla, S. Towards Deep-Learning-Driven Intrusion Detection for the Internet of Things. Sensors 2019, 19, 1977. [Google Scholar] [CrossRef] [Green Version]
- Rodríguez, E.; Otero, B.; Gutiérrez, N.; Canal, R. A Survey of Deep Learning Techniques for Cybersecurity in Mobile Networks. IEEE Commun. Surv. Tutor. 2021, 23, 1920–1955. [Google Scholar] [CrossRef]
- Wu, P.; Guo, H.; Buckland, R. A Transfer Learning Approach for Network Intrusion Detection. In Proceedings of the IEEE 4th International Conference on Big Data Analytics ICBDA, Suzhou, China, 15 March 2019; pp. 281–285. [Google Scholar]
- Ruder, S.; Peters, M.; Swayamdipta, S.; Wolf, T. A Transfer Learning in Natural Language Processing Tutorial. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics, Minneapolis, Minnesota, 1 June 2019; pp. 15–19. [Google Scholar]
- Kasthurirangan, G.; Khaitan, S.; Choudhary, A.; Agrawal, A. Deep Convolutional Neural Networks with transfer learning for computer vision-based data-driven pavement distress detection. Constr. Build Mater. 2017, 157, 322–330. [Google Scholar]
- BoT IoT Dataset. Available online: https://research.unsw.edu.au/projects/bot-iot-dataset (accessed on 27 May 2022).
- Moustafa, N.; Slay, J. UNSW-NB15: A comprehensive data set for network intrusion detection systems (UNSW-NB15 network data set). In Proceedings of the Military Communications and Information Systems Conference MilCIS, Canberra, Australia, 10 November 2015; pp. 1–6. [Google Scholar]
- NSL-KDD. Available online: http://kdd.ics.uci.edu/databases/kddcup99/kddcup99.html (accessed on 27 May 2022).
- Masum, M.; Shahriar, H. TL-NID: Deep Neural Network with Transfer Learning for Network Intrusion Detection. In Proceedings of the 15th International Conference for Internet Technology and Secured Transactions ICITST, London, UK, 8 December 2020; pp. 1–7. [Google Scholar]
- Sameera, N.; Shashi, M. Transfer Learning Based Prototype for Zero-Day Attack Detection. Int. J. Eng. Adv. Technol. 2019, 8, 1326–1329. [Google Scholar]
- Zhao, J.; Shetty, S.; Pan, J.W. Feature-based transfer learning for network security. In Proceedings of the IEEE Military Communications Conference MILCOM, Baltimore, MD, USA, 23 October 2017; pp. 17–22. [Google Scholar]
- Singla, A.; Bertino, E.; Verma, D. Overcoming the Lack of Labeled Data: Training Intrusion Detection Models Using Transfer Learning. In Proceedings of the IEEE International Conference on Smart Computing SMARTCOMP, Washington, DC, USA, 12 June 2019; pp. 69–74. [Google Scholar]
- Li, X.; Hu, Z.; Xu, M.; Wang, Y.; Ma, J. Transfer learning based intrusion detection scheme for Internet of vehicles. Inf. Sci. 2021, 547, 119–135. [Google Scholar] [CrossRef]
- Kolias, C.; Kambourakis, G.; Stavrou, A.; Gritzalis, S. Intrusion detection in 802.11 networks: Empirical evaluation of threats and a public dataset. IEEE Commun. Surv. Tutor. 2015, 18, 184–208. [Google Scholar] [CrossRef]
- Mehedi, S.T.; Anwar, A.; Rahman, Z.; Ahmed, K. Deep Transfer Learning Based Intrusion Detection System for Electric Vehicular Networks. Sensors 2021, 21, 4736. [Google Scholar] [CrossRef]
- Kang, H.; Kwak, B.; Lee, Y.H.; Lee, H.; Lee, H.; Kim, H.K. Car Hacking: Attack and Defense Challenge 2020 Dataset. IEEE Dataport 2021. Available online: https://ieee-dataport.org/open-access/car-hacking-attack-defense-challenge-2020-dataset (accessed on 27 May 2022).
- Fan, Y.; Li, Y.; Zhan, M.; Cui, H.; Zhang, Y. IoTDefender: A Federated Transfer Learning Intrusion Detection Framework for 5G IoT. In Proceedings of the IEEE 14th International Conference on Big Data Science and Engineering BigDataSE, Guangzhou, China, 1 January 2021; pp. 88–95. [Google Scholar]
- Sharafaldin, I.; Habibi Lashkari, A.; Ghorbani, A.A. New Intrusion Detection Dataset and Intrusion Traffic Characterization. In Proceedings of the 4th International Conference on Information Systems Security and Privacy ICISSP, Funchal, Portugal, 24 January 2018; pp. 108–116. [Google Scholar]
- 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]
- ToN IoT Dataset. Available online: https://research.unsw.edu.au/projects/toniot-datasets (accessed on 27 May 2022).
- Guan, J.; Cai, J.; Bai, H. Deep transfer learning-based network traffic classification for scarce dataset in 5G IoT systems. Int. J. Mach. Learn. Cyber 2021, 12, 3351–3365. [Google Scholar] [CrossRef]
- Sun, G.; Liang, L.; Chen, T.; Xiao, F.; Lang, F. Network traffic classification based on transfer learning. Comput. Electr. Eng. 2018, 69, 920–927. [Google Scholar] [CrossRef]
- Tan, M.; Le, Q. EfficientNet: Rethinking model scaling for convolutional neural networks. In Proceedings of the 36th International Conference on Machine Learning PMLR, Long Beach, CA, USA, 15 June 2019; pp. 6105–6114. [Google Scholar]
- Kolesnikov, A.; Beyer, L.; Zhai, X.; Puigcerver, J.; Yung, J.; Gelly, S.; Houlsby, N. Big Transfer (BiT): General visual representation learning. In Proceedings of the European Conference on Computer Vision ECCV, Glasgow, UK, 28 August 2020; pp. 491–507. [Google Scholar]
- USTC-TFC2016. Available online: https://github.com/yungshenglu/USTC-TFC2016/ (accessed on 27 May 2022).
- Mehedi, S.T.; Anwar, A.; Rahman, Z.; Ahmed, K.; Islam, R. Dependable Intrusion Detection System for IoT: A Deep Transfer Learning-based Approach. IEEE Trans. Ind. Inf. 2022, 1, 1–12. [Google Scholar] [CrossRef]
- LeCun, Y.; Bengio, Y. Convolutional networks for images, speech, and time series. In The Handbook of Brain Theory and Neural Networks; Arbib, M.A., Ed.; MIT Press: Cambridge, MA, USA, 1998; pp. 255–258. [Google Scholar]
- Waibel, A.; Hanazawa, T.; Hinton, G.; Shikano, K.; Lang, K.J. Phoneme recognition using time-delay neural networks. IEEE Trans. Acoust. Speech Lang. Process. 1989, 37, 328–339. [Google Scholar] [CrossRef]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet classification with deep convolutional neural networks. Adv. Neural Inf. Process. Syst. 2012, 25, 1097–1105. [Google Scholar] [CrossRef]
- Roopak, M.; Tian, G.Y.; Chambers, J. Deep learning models for cyber security in IoT networks. In Proceedings of the 9th IEEE Annual Computing and Communication Workshop and Conference (CCWC), Las Vegas, NV, USA, 7 January 2019; pp. 452–457. [Google Scholar]
- Lotfollahi, M.; Jafari Siavoshani, M.; Shirali Hossein Zade, R.; Saberian, M. Deep packet a novel approach for encrypted traffic classification using deep learning. Soft. Comput. 2019, 24, 1–14. [Google Scholar] [CrossRef] [Green Version]
- Krishna, S.T.; Kalluri, H.K. Deep Learning and Transfer Learning Approaches for Image Classification. Int. J. Recent Technol. Eng. 2019, 7, 427–432. [Google Scholar]
- Zhuang, F.; Qi, Z.; Duan, K.; Xi, D.; Zhu, Y.; Zhu, H.; Xiong, H.; He, Q. A Comprehensive Survey on Transfer Learning. Proc. IEEE 2021, 109, 43–76. [Google Scholar] [CrossRef]
- Pan, S.J.; Yang, Q. A Survey on Transfer Learning. IEEE Trans. Knowl. Data Eng. 2010, 22, 1345–1359. [Google Scholar] [CrossRef]
- Tan, C.; Sun, F.; Kong, T.; Zhang, W.; Yang, C.; Liu, C. A Survey on Deep Transfer Learning. In Proceedings of the Artificial Neural Networks and Machine Learning (ICANN), Rhodes, Greece, 4 October 2018; pp. 270–279. [Google Scholar]
- Yosinski, J.; Clune, J.; Bengio, Y.; Lipson, H. How transferable are features in deep neural networks? Adv. Neural Inf. Process. Syst. 2014, 27, 1–9. [Google Scholar]
- TensorFlow. Available online: https://www.tensorflow.org/ (accessed on 27 May 2022).
- Keras: The Python Deep Learning Library. Available online: https://keras.io/ (accessed on 27 May 2022).
- TL-Based IDS Framework GitHub Repository. Available online: http://github.com/polvalls9/Transfer-Learning-Based-Intrusion-Detection-in-5G-and-IoT-Networks (accessed on 27 May 2022).
Reference | TL | Source Dataset | Target Dataset | Accuracy |
---|---|---|---|---|
Wu et al. [7] (2019) | CNN-CNN | UNSW-NB15 | NSL-KDD | 81.94% |
Masum et al. [13] (2020) | DNN-DNN | VGG-16 | NSL-KDD | 70.97% |
Sameera et al. [14] (2019) | PCA-KNN | NSL-KDD (DoS+ Normal) | NSL-KDD (R2L+ Normal) | 89.79% |
Singla et al. [16] (2019) | DNN-DNN | UNSW-NB15 Subset | UNSW-NB15 Subset (single new attack) | 95–98% |
Li et al. [17] (2021) | SVM-RF | AWID | AWID | 96% |
Mehedi et al. [19] (2021) | CNN-CNN | Custom | Custom | 98.1% |
Fan et al. [21] (2021) | CNN-CNN | CICIDS2017 | Custom | 91.93% |
Idrissi et al. [23] (2021) | CNN-CNN | BoT-IoT | TON-IoT | 99.43% |
Guan et al. [25] (2021) | BiT EfficientNet | Custom | 10% USTC-TFC2016 | 96% |
Mehedi et al. [30] (2022) | CNN | Custom | Custom | 87% |
Category | Subcategory | Records | Description |
---|---|---|---|
Normal | Normal | 9543 | Natural transaction data. |
DoS | TCP UDP HTTP | 38,532,480 | A malicious attack to cripple the services offered by a site, server, or network overloading the target of its associated infrastructure by flooding the site with many requests. |
DDoS | TCP UDP HTTP | 33,005,194 | Attack where multiple compromised computer systems attack a target, causing a DoS. |
Reconnaissance | OS fingerprinting Service scanning | 1,821,639 | All the different strikes simulating attacks gathering information. |
Information Theft | Keylogging Data exfiltration | 1587 | Stealing of personal user information. |
Category | Records | Description |
---|---|---|
Normal | 2,218,761 | Natural transaction data. |
Generic | 215,481 | Attack against blockciphers with a given block and key size (not considering its structure). |
Exploits | 44,525 | Attack that exploits vulnerabilities, taking advantage of security problems (of an operating system or a piece of software) known by the attackers. |
Fuzzers | 24,246 | Attack that suspends a program or network, feeding it with randomly generated data. |
DoS | 16,353 | A malicious attack that makes a server or network resource unavailable, overloading the target of the associated infrastructure with a flood of Internet traffic. |
Reconnaissance | 13,987 | Comprises different attacks that gather information. |
Analysis | 2677 | Different attacks on penetrations (HTML files, spam, and port scan). |
Backdoors | 2329 | An attack that bypasses a system security mechanism to access a computer or its data. |
Shellcode | 1511 | Attack that exploits software vulnerabilities using small pieces of code as payloads. |
Worms | 174 | Attack where the attacker replicates itself to spread to other computers. |
UNSW-NB15-Basic-Train | UNSW-NB15-Basic-Test | |||
---|---|---|---|---|
Name | Records | Percentage | Records | Percentage |
Normal | 217,552 | 49.95% | 72,794 | 50.14% |
Generic | 161,865 | 37.17% | 53,616 | 36.93% |
Exploits | 33,408 | 7.67% | 11,117 | 7.66% |
DoS | 12,196 | 2.80% | 4157 | 2.86% |
Reconnaissance | 10,498 | 2.41% | 3489 | 2.40% |
UNSW-NB15-Test+ | UNSW-NB15-Test | |||
---|---|---|---|---|
Name | Records | Percentage | Records | Percentage |
Normal | 30,937 | 50.00% | 321,283 | 50.00% |
Generic | - | - | 215,481 | 33.53% |
Exploits | - | - | 44,525 | 6.93% |
DoS | - | - | 16,353 | 2.54% |
Reconnaissance | - | - | 13,987 | 2.18% |
Fuzzers | 24,246 | 39.19% | 24,246 | 3.77% |
Analysis | 2677 | 4.33% | 2677 | 0.42% |
Backdoor | 2329 | 3.76% | 2329 | 0.36% |
Shellcode | 1511 | 2.44% | 1511 | 0.24% |
Worms | 174 | 0.28% | 174 | 0.03% |
Dataset | Normal | Attack | % Attack | % Novel Attack |
---|---|---|---|---|
BoT-IoT | 9543 | 5,823,226 | 99.84% | - |
UNSW-NB15-Basic-Train | 217,552 | 217,967 | 50.04% | - |
UNSW-NB15-Basic-Test | 72,794 | 72,379 | 49.85% | 0.00% |
UNSW-NB15-Test+ | 30,937 | 30,937 | 50.00% | 100.00% |
UNSW-NB15-Test | 321,283 | 321,283 | 50.00% | 9.63% |
BoT-IoT | UNSW-NB15 | Type | Description | |
---|---|---|---|---|
1 | proto | proto | nominal | Textual representation of transaction protocols present in network flow. |
2 | saddr | srcip | nominal | Source IP address. |
3 | sport | sport | integer | Source port number. |
4 | daddr | dstip | nominal | Destination IP address. |
5 | dport | dsport | integer | Destination port number. |
6 | spkts | spkts | float | Source-to-destination packet count. |
7 | dpkts | dpkts | float | Destination-to-source packet count. |
8 | sbytes | sbytes | float | Source-to-destination byte count. |
9 | dbytes | dbytes | float | Destination-to-source byte count. |
10 | state | state | nominal | Transaction state. |
11 | stime | stime | timestamp | Record start time. |
12 | ltime | ltime | timestamp | Record last time. |
13 | dur | dur | float | Record total duration. |
14 | attack | label | binary | Class label: 0 for normal traffic, 1 for attack. |
15 | category | attack_cat | nominal | Cyberattack family. |
Classification Head | Layer 1 | Layer 2 | Layer 3 | Output Layer |
---|---|---|---|---|
Number of neurons | 448 | 224 | 112 | 2 |
Dropout probability | 0.4 | 0.3 | 0.3 | - |
Activation | ReLu | ReLu | ReLu | Softmax |
Model | Epochs | Batch Size | Optimizer | Learning Rate | Loss |
---|---|---|---|---|---|
CNN-B | 25 | 208 | Adam | Categorical cross-entropy | |
CNN-TL | 15 | 4096 | Adam | Categorical cross-entropy |
Traffic | Detection Rate | Detected Samples | Non Detected Samples |
---|---|---|---|
Normal | 98.34% | 30,358 | 513 |
Analysis | 100.00% | 622 | 0 |
Backdoor | 100.00% | 357 | 0 |
Fuzzers | 99.95% | 21,507 | 10 |
Shellcode | 99.93% | 1510 | 1 |
Worms | 98.85% | 172 | 2 |
Traffic | Detection Rate | Detected Samples | Non Detected Samples |
---|---|---|---|
Normal | 98.53% | 315,902 | 46,081 |
DoS | 99.43% | 3841 | 22 |
Exploits | 99.75% | 28,249 | 68 |
Generic | 99.98% | 213,678 | 40 |
Reconnaissance | 99.94% | 11,848 | 6 |
Analysis | 99.84% | 621 | 1 |
Backdoor | 99.44% | 355 | 2 |
Fuzzers | 99.79% | 21,472 | 45 |
Shellcode | 99.93% | 1510 | 1 |
Worms | 98.85% | 172 | 2 |
UNSW-NB15-Test | UNSW-NB15-Test+ | |||||
---|---|---|---|---|---|---|
Traffic | CNN | TL | Improvement | CNN | TL | Improvement |
Normal | 99.65% | 98.54% | −1.11% | 98.52% | 98.34% | −0.18% |
DoS | 96.73% | 99.43% | 2.7 0% | - | - | - |
Exploits | 97.90% | 99.76% | 1.86% | - | - | - |
Generic | 99.16% | 99.98% | 0.82% | - | - | - |
Reconnaissance | 92.85% | 99.95% | 7.10% | - | - | - |
Analysis | 86.14% | 99.84% | 13.7% | 66.72% | 100.00% | 33.28% |
Backdoor | 83.62% | 99.44% | 15.82% | 89.64% | 100.00% | 16.38% |
Fuzzers | 80.76% | 99.79% | 19.03% | 69.20% | 99.95% | 30.75% |
Shellcode | 89.43% | 99.93% | 10.50% | 98.34% | 99.93% | 1.59% |
Worms | 96.31% | 98.85% | 2.54% | 95.97% | 98.85% | 2.88% |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
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. https://doi.org/10.3390/s22155621
Rodríguez E, Valls P, Otero B, Costa JJ, Verdú J, Pajuelo MA, Canal R. Transfer-Learning-Based Intrusion Detection Framework in IoT Networks. Sensors. 2022; 22(15):5621. https://doi.org/10.3390/s22155621
Chicago/Turabian StyleRodríguez, Eva, Pol Valls, Beatriz Otero, Juan José Costa, Javier Verdú, Manuel Alejandro Pajuelo, and Ramon Canal. 2022. "Transfer-Learning-Based Intrusion Detection Framework in IoT Networks" Sensors 22, no. 15: 5621. https://doi.org/10.3390/s22155621