Machine Learning-Based Anomaly Detection For Smart Home Networks Under Adversarial Attack
Machine Learning-Based Anomaly Detection For Smart Home Networks Under Adversarial Attack
Corresponding Author:
Juli Rejito
Department of Informatics, Faculty of Mathematics and Science, Universitas Padjadjaran
Jl. Raya Bandung Sumedang KM.21, Hegarmanah, Jatinangor, Jawa Barat 45363, Indonesia
Email: [email protected]
1. INTRODUCTION
As smart home networks become more widespread and intricate, they provide users with access to a
wide range of applications and services, ranging from smart lighting and heating to security [1]. These networks
are composed of a variety of devices, including sensor, actuator, camera, and smart appliance sensors, that interact
with one another and external servers through either wireless or wired communication protocols [2]. These
devices and protocols, however, often have low levels of security and are susceptible to a variety of attacks from
malicious adversaries. These attacks may include denial of service (DOS) attacks to disrupt network functionality,
phishing attacks to create a false identity for a legitimate device or user, listening in on conversations to acquire
sensitive information, and tampering attacks to modify the device's status or commands [3]–[6]. The consequences
of these attacks can range from privacy violations to property damage and even physical harm.
To identify and prevent attacks on smart home networks, anomaly detection is a useful method. It
observes the network behavior and spots any abnormal changes that suggest malicious actions. The detection can
happen at various levels of detail, such as device-level, network-level, or application-level [7]; it can also use
different kinds of data sources, such as device states, network traffic, user feedback, or environmental factors [8],
[9]. Furthermore, anomaly detection can provide prompt warnings and reactions to the users or network
administrators, and assist in securing the smart home networks from potential threats [10].
Nevertheless, anomaly detection in smart home networks faces several challenges that require novel
solutions [1]. One of the main challenges is the presence of adversarial attacks that can manipulate the network
data or models to evade or mislead the anomaly detection systems [11]. An adversarial attack occurs when an
adversarial example is fed as an input to a machine learning model. An adversarial example is an instance of the
input in which some feature has been intentionally perturbed with the intention of confusing a machine learning
model to produce a wrong prediction. Adversarial attacks can be launched at different stages of the anomaly
detection process, such as data collection, feature extraction, model training, or model inference. Adversarial
attacks can also have different objectives and strategies, such as reducing the detection accuracy, increasing the
false alarm rate, or causing specific misclassifications, which in turn can pose serious threats to the reliability and
robustness of the anomaly detection systems in smart home networks.
Many research works attempt to address the issues of adversarial attacks on smart home network have
been proposed. A popular way to find anomalies in smart home networks is to rely on network traffic data as
the primary information source. Network traffic data can record the exchanges and connections between the
network devices and servers, and show the network activity and quality. Network traffic data can be examined
using different methods, such as statistical methods, rule-based methods, clustering methods, or machine
learning methods.
As an example, Wang, et al. [12] proposed a statistical method that uses entropy and correlation
coefficient to identify abnormal patterns in smart home networks. Kalnoor and Gowrishankar [13] introduced
a statistical method that uses Markov chains and hypothesis testing to identify abnormal patterns in IoT
networks. Statistical methods are simple and efficient, but they may suffer from low accuracy and high false
alarm rate, especially when the network traffic data is noisy or non-stationary. Usman, Muthukkumarasamy
and Wu [14] suggested a rule-based method that uses fuzzy logic to identify abnormal patterns in smart home
networks. Graf, et al. [15] proposed a rule-based method that uses decision trees to identify abnormal patterns
in smart home networks. Rule-based methods are easy to apply and understand, but they may lack adaptability
and scalability, especially when the network traffic data is dynamic or heterogeneous. Gadal, et al. [16] and
Stiawan, et al. [17] suggested a clustering method that uses K-Means to identify abnormal patterns in smart
home networks. Li, et al. [18] suggested a clustering method that uses density-based spatial clustering of
applications with noise (DBSCAN) to identify abnormal patterns in smart home networks. Clustering methods
are flexible and robust, but they may require high computational complexity and sensitivity to parameters,
especially when the network traffic data is high-dimensional or sparse. Using supervised or semi-supervised
learning techniques, machine learning methods train classifiers that can separate normal and abnormal
behaviors in network traffic data [19]. For instance, Nanthiya, et al. [20] proposed a machine learning method
that uses support vector machines (SVM) to identify anomalies in smart home networks. Similarly, Bokka and
Sadasivam [21] and Latif et al. [22] proposed a machine learning method that uses deep neural networks (DNN)
to identify anomalies in smart home networks. Machine learning methods are effective and precise, but they
may need high data and model resources and have low explainability, especially when the network traffic data
is skewed or complicated.
This paper proposes a machine learning-based anomaly detection method for smart home networks
under adversarial attack. The proposed method leverages the network traffic data and extracts relevant features
to train a supervised classifier that can distinguish between normal and anomalous behaviors. Various
adversarial attack scenarios are also designed and implemented to evaluate the performance and robustness of
the proposed method. Then, extensive experiments on real-world smart home network datasets are conducted
and the results are compared with several baseline methods.
The main contributions of this paper are as follows,
− A novel machine learning-based anomaly detection method for smart home networks that can handle both
benign and malicious anomalies.
− Design and implementation of various adversarial attack scenarios that target different stages and
objectives of the anomaly detection process.
The rest of this paper is organized as follows: Section 2 describes the proposed methodology of our
machine learning-based anomaly detection method. Section 3 presents and analyzes the experimental set up
and results of our method under different adversarial attack scenarios. Section 4 concludes the paper and
provides an outlook on the future work.
2. METHOD
This section describes the proposed methodology of the machine learning-based anomaly detection
method for smart home networks under adversarial attack. The proposed methodology consists of four main
Machine learning-based anomaly detection for smart home networks under adversarial attack (Juli Rejito)
124 ISSN: 2722-3221
steps: data collection and preprocessing, feature extraction and selection, model training and testing, and
evaluation. Figure 1 shows the overview of the proposed methodology.
Having done preliminary experiments, the best MLP has three hidden layers with 64 neurons each
and a rectified linear unit (ReLU) activation function. The output layer has a softmax activation function that
gives the class probabilities for each flow. The error between the true class labels and the predicted class
probabilities is calculated by the categorical cross-entropy loss function. The weights of the MLP are updated
by the Adam optimizer using gradient descent. The batch size is 128 and the epoch size is 10 for training. 80%
of the network traffic data is used for training and 20% for testing. Stratified sampling is applied to make sure
each class is equally represented in both sets. Two adversarial defense techniques are used to make the MLP
more resilient to adversarial attacks. The first technique is adversarial training, which adds adversarial
examples created by different attack methods to the training set. The second technique is distillation, which
lowers the sensitivity of the MLP to adversarial perturbations by using parameters.
𝑇𝑟𝑢𝑒 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠
𝑅𝑒𝑐𝑎𝑙𝑙 = (2)
𝑇𝑟𝑢𝑒 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠+𝐹𝑎𝑙𝑠𝑒 𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒𝑠
Machine learning-based anomaly detection for smart home networks under adversarial attack (Juli Rejito)
126 ISSN: 2722-3221
Where,
D = Discriminator
G = Generator
Pdata(x) = distribution of real data
P(z) = distribution of generator
x = sample from Pdata(x)
z = sample from P(z)
D(x) = Discriminator network
G(z) = Generator network
Algorithm GAN
While number of training iterations do
While j<m steps do
Input m sample data {z(1), …, z(m)} from P(z) generator
Input m sample data {x(1), …, x(m)} from Pdata(x) dataset
Update the discriminator using Equation (2)
End while
Input m sample data {z(1), …, z(m)} from P(z) generator
Update the discriminator using momentum and 𝛻 = ∑𝑚 (𝑖)
𝑖=1[(1 − 𝑙𝑜𝑔𝐷 (𝐺(𝑧 ))]
End while
3.4. Discussion
The propsed detection system was tested and found that it can detect anomalies in smart home
networks with a good accuracy and sensitivity (recall), and can resist different kinds of adversarial attacks. The
proposed method performs better than several existing methods, such as SVM, K-Means, decision tree
(entropy-based) or machine learning [27] methods, in different adversarial attack situations. The proposed
detection system uses the network traffic data and selects important features to train the MLP classifier that
can tell apart normal and anomalous behaviors even under adversarial attack condition, because it uses some
adversarial defense techniques, such as adversarial training and distillation, to improve the strength of the MLP
classifier. Table 2 shows the worst impact of adversarial attacks on the proposed system is 26% accuracy
degradation, which is acceptable [29]. Table 3 shows that the proposed system still perfoms well under
adversarial attacks situation. Thus, the proposed method can offer a trustworthy and safe solution for smart
home network anomaly detection. Furthermore, the proposed method can also support the researchers or
practitioners to create and improve more efficient and strong anomaly detection system for smart home
networks.
4. CONCLUSION
A machine learning-based anomaly detection system for smart home networks under adversarial
attack has been propopsed. The proposed method leveraged the network traffic data and extracted relevant
features to train MLP classifier that could distinguish between normal and anomalous behaviors. The proposed
system also applied adversarial training and distillation, to enhance the robustness of the MLP classifier.
Experimental results showed the performance and robustness of the proposed method on two real-world smart
home network data sets under different adversarial attack scenarios. We compared the proposed system with
several baseline methods, such as SVM, K-Means, decision tree and ML-based methods. The results showed
that the proposed system achieved high accuracy and recall in detecting anomalies in smart home networks on
UNSW-NB15 and IoT23 datasets, and was resilient to different types of adversarial attacks. Some limitations
are revealed after performing the experiments. The proposed method requires a large amount of labeled data
for training and testing, which may not be available or feasible in real-world scenarios, and a fixed set of
features that may not capture all the aspects of the network behavior or adapt to the changes in the network
Machine learning-based anomaly detection for smart home networks under adversarial attack (Juli Rejito)
128 ISSN: 2722-3221
environment. The use of MLP as the classifier may have high data and model requirements and low
interpretability. Other limitation is that the proposed system is evaluated under specific adversarial attack
scenarios that may not cover all the possible types or techniques of adversarial attacks. Some of the future
directions included the use of semi-supervised learning techniques to reduce the dependency on labeled data,
using more advanced feature extraction and selection techniques to capture more relevant and diverse features,
using more sophisticated or explainable machine learning models or techniques for anomaly detection, and
designing and implementing more realistic or comprehensive adversarial attack scenarios and defense
techniques.
REFERENCES
[1] J. I. I. Araya and H. Rifà-Pous, “Anomaly-based cyberattacks detection for smart homes: A systematic literature review,” Internet
of Things (Netherlands), vol. 22, 2023, doi: 10.1016/j.iot.2023.100792.
[2] B. K. Sovacool and D. D. Furszyfer Del Rio, “Smart home technologies in Europe: A critical review of concepts, benefits, risks and
policies,” Renewable and Sustainable Energy Reviews, vol. 120, 2020, doi: 10.1016/j.rser.2019.109663.
[3] O. Taiwo and A. E. Ezugwu, “Internet of things-based intelligent smart home control system,” Security and Communication
Networks, vol. 2021, 2021, doi: 10.1155/2021/9928254.
[4] T. A. A Abdullah, W. Ali, S. Malebary, A. A. Ahmed Abdullah, T. A. Abdullah, and A. Ali Ahmed, “A review of cyber security
challenges, attacks and solutions for internet of things based smart home,” IJCSNS International Journal of Computer Science and
Network Security, vol. 19, no. 9, pp. 139–146, 2019, [Online]. Available: https://www.researchgate.net/publication/336717887.
[5] H. Chi, C. Fu, Q. Zeng, and X. Du, “Delay wreaks havoc on your smart home: delay-based automation interference attacks,”
Proceedings - IEEE Symposium on Security and Privacy, vol. 2022-May, pp. 285–302, 2022, doi: 10.1109/SP46214.2022.9833620.
[6] A. Khraisat and A. Alazab, “A critical review of intrusion detection systems in the internet of things: techniques, deployment
strategy, validation strategy, attacks, public datasets and challenges,” Cybersecurity, vol. 4, no. 1, 2021, doi: 10.1186/s42400-021-
00077-7.
[7] M. H. Bhuyan, D. K. Bhattacharyya, and J. K. Kalita, “Network anomaly detection: Methods, systems and tools,” IEEE
Communications Surveys and Tutorials, vol. 16, no. 1, pp. 303–336, 2014, doi: 10.1109/SURV.2013.052213.00046.
[8] E. A. Abuemera, H. A. Elzouka, and A. A. Saad, “Security framework for identifying threats in smart manufacturing systems using
STRIDE approach,” 2022 2nd International Conference on Consumer Electronics and Computer Engineering, ICCECE 2022, pp.
605–612, 2022, doi: 10.1109/ICCECE54139.2022.9712770.
[9] S. G. Abbas, S. Zahid, F. Hussain, G. A. Shah, and M. Husnain, “A threat modelling approach to analyze and mitigate botnet attacks
in smart home use case,” Proceedings - 2020 IEEE 14th International Conference on Big Data Science and Engineering, BigDataSE
2020, pp. 122–129, 2020, doi: 10.1109/BigDataSE50710.2020.00024.
[10] R. Zhu, X. Wu, J. Sun, and Z. Li, “Research on smart home security threat modeling based on STRIDE-IAHP-BN,” Proceedings -
2021 20th International Symposium on Distributed Computing and Applications for Business Engineering and Science, DCABES
2021, pp. 207–213, 2021, doi: 10.1109/DCABES52998.2021.00059.
[11] J. Fu, L. Wang, J. Ke, K. Yang, and R. Yu, “GANAD: A GAN-based method for network anomaly detection,” World Wide Web,
vol. 26, no. 5, pp. 2727–2748, 2023, doi: 10.1007/s11280-023-01160-4.
[12] Y. Sun, J. Yu, J. Tian, Z. Chen, W. Wang, and S. Zhang, “IoT-IE: an information-entropy-based approach to traffic anomaly
detection in internet of things,” Security and Communication Networks, vol. 2021, 2021, doi: 10.1155/2021/1828182.
[13] G. Kalnoor and S. Gowrishankar, “A model for intrusion detection system using hidden Markov and variational Bayesian model
for IoT based wireless sensor network,” International Journal of Information Technology (Singapore), vol. 14, no. 4, pp. 2021–
2033, 2022, doi: 10.1007/s41870-021-00748-1.
[14] M. Usman, V. Muthukkumarasamy, and X. W. Wu, “Mobile agent-based cross-layer anomaly detection in smart home sensor
networks using fuzzy logic,” IEEE Transactions on Consumer Electronics, vol. 61, no. 2, pp. 197–205, 2015, doi:
10.1109/TCE.2015.7150594.
[15] J. Graf, K. Neubauer, S. Fischer, and R. Hackenberg, “Architecture of an intelligent intrusion detection system for smart home,”
2020 IEEE International Conference on Pervasive Computing and Communications Workshops, PerCom Workshops 2020, 2020,
doi: 10.1109/PerComWorkshops48775.2020.9156168.
[16] S. Gadal, R. Mokhtar, M. Abdelhaq, R. Alsaqour, E. S. Ali, and R. Saeed, “Machine learning-based anomaly detection using k-
mean array and sequential minimal optimization,” Electronics (Switzerland), vol. 11, no. 14, 2022, doi:
10.3390/electronics11142158.
[17] D. Stiawan et al., “Ping flood attack pattern recognition using a K-means algorithm in an internet of things (IoT) network,” IEEE
Access, vol. 9, pp. 116475–116484, 2021, doi: 10.1109/ACCESS.2021.3105517.
[18] X. Li, H. Ghodosi, C. Chen, M. Sankupellay, and I. Lee, “Improving network-based anomaly detection in smart home environment,”
Sensors, vol. 22, no. 15, 2022, doi: 10.3390/s22155626.
[19] A. B. Nassif, M. A. Talib, Q. Nasir, and F. M. Dakalbab, “Machine learning for anomaly detection: a systematic review,” IEEE
Access, vol. 9, pp. 78658–78700, 2021, doi: 10.1109/ACCESS.2021.3083060.
[20] D. Nanthiya, P. Keerthika, S. B. Gopal, S. B. Kayalvizhi, T. Raja, and R. S. Priya, “SVM based DDoS attack detection in IoT using
IoT-23 BotNet dataset,” 3rd IEEE International Virtual Conference on Innovations in Power and Advanced Computing
Technologies, i-PACT 2021, 2021, doi: 10.1109/i-PACT52855.2021.9696569.
[21] R. Bokka and T. Sadasivam, “Deep learning model for detection of attacks in the internet of things based smart home environment,”
Advances in Intelligent Systems and Computing, vol. 1245, pp. 725–735, 2021, doi: 10.1007/978-981-15-7234-0_69.
[22] S. Latif et al., “Intrusion detection framework for the internet of things using a dense random neural network,” IEEE Transactions
on Industrial Informatics, vol. 18, no. 9, pp. 6435–6444, 2022, doi: 10.1109/TII.2021.3130248.
[23] N. Moustafa and J. Slay, “UNSW-NB15: A comprehensive data set for network intrusion detection systems (UNSW-NB15 network
data set),” 2015 Military Communications and Information Systems Conference, MilCIS 2015 - Proceedings, 2015, doi:
10.1109/MilCIS.2015.7348942.
[24] A. P. and M. J. Erquiaga, “IOT-23,” 2023, [Online]. Available: https://www.stratosphereips.org/datasets-iot23.
[25] I. J. Goodfellow et al., “Generative adversarial nets,” Advances in Neural Information Processing Systems, vol. 3, no. January, pp.
2672–2680, 2014, doi: 10.1007/978-3-658-40442-0_9.
[26] T. Schlegl, P. Seeböck, S. M. Waldstein, U. Schmidt-Erfurth, and G. Langs, “Unsupervised anomaly detection with generative
adversarial networks to guide marker discovery,” Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial
Intelligence and Lecture Notes in Bioinformatics), vol. 10265 LNCS, no. 2, pp. 146–147, 2017, doi: 10.1007/978-3-319-59050-
9_12.
[27] T. Li, Z. Hong, and L. Yu, “Machine learning-based intrusion detection for IoT devices in smart home,” IEEE International
Conference on Control and Automation, ICCA, vol. 2020-Octob, pp. 277–282, 2020, doi: 10.1109/ICCA51439.2020.9264406.
[28] T. Zixu, K. S. K. Liyanage, and M. Gurusamy, “Generative adversarial network and auto encoder-based anomaly detection in
distributed IoT networks,” 2020 IEEE Global Communications Conference, GLOBECOM 2020 - Proceedings, vol. 2020-Janua,
2020, doi: 10.1109/GLOBECOM42002.2020.9348244.
[29] O. Ibitoye, O. Shafiq, and A. Matrawy, “Analyzing adversarial attacks against deep learning for intrusion detection in IoT
networks,” 2019 IEEE Global Communications Conference, GLOBECOM 2019 - Proceedings, 2019, doi:
10.1109/GLOBECOM38437.2019.9014337.
BIOGRAPHIES OF AUTHORS
Machine learning-based anomaly detection for smart home networks under adversarial attack (Juli Rejito)