Author ORCID Identifier

Document Type



Available under a Creative Commons Attribution Non-Commercial Share Alike 4.0 International Licence


1.2 COMPUTER AND INFORMATION SCIENCE, 2.2 ELECTRICAL, ELECTRONIC, INFORMATION ENGINEERING, Communication engineering and systems, telecommunications

Publication Details

Tomer, V.; Sharma, S. Detecting IoT Attacks Using an Ensemble Machine Learning Model. Future Internet 2022, 14, 102.

Published Open Access by MDPI:


Malicious attacks are becoming more prevalent due to the growing use of Internet of Things (IoT) devices in homes, offices, transportation, healthcare, and other locations. By incorporating fog computing into IoT, attacks can be detected in a short amount of time, as the distance between IoT devices and fog devices is smaller than the distance between IoT devices and the cloud. Machine learning is frequently used for the detection of attacks due to the huge amount of data available from IoT devices. However, the problem is that fog devices may not have enough resources, such as processing power and memory, to detect attacks in a timely manner. This paper proposes an approach to offload the machine learning model selection task to the cloud and the real-time prediction task to the fog nodes. Using the proposed method, based on historical data, an ensemble machine learning model is built in the cloud, followed by the real-time detection of attacks on fog nodes. The proposed approach is tested using the NSL-KDD dataset. The results show the effectiveness of the proposed approach in terms of several performance measures, such as execution time, precision, recall, accuracy, and ROC (receiver operating characteristic) curve.



NGIAtlantic H2020 project under agreement no. OC3-292