From Risk to Protection: Smart Threat Detection in IoT Using Machine Learning

Main Article Content

Rafael Sebastião Galdino
Vitor Lucas Silva Santos
Demóstenes Zegarra Rodríguez
Renata Lopes Rosa
André de Lima Salgado

Abstract

The rapid expansion of Internet of Things (IoT) ecosystems has significantly increased the attack surface of modern networks, demanding efficient and lightweight security solutions. This paper presents a machine learning–based intrusion detection system (IDS) designed for IoT environments, focusing on the balance between detection accuracy and computational efficiency. The proposed approach employs both supervised learning algorithms (Decision Tree and Random Forest) and unsupervised techniques (K-means and DBSCAN), using the NSL-KDD dataset as the experimental benchmark. Data preprocessing includes normalization and categorical feature encoding to ensure model stability and performance. Supervised models are evaluated using accuracy and weighted F1-score, while unsupervised methods are assessed through clustering metrics such as Adjusted Rand Index, Normalized Mutual Information, and silhouette coefficient. Experimental results demonstrate that supervised models achieve near-perfect classification performance, with Random Forest slightly outperforming Decision Tree, particularly for minority attack classes. The selected model is deployed and validated on a Raspberry Pi Desktop platform, achieving high accuracy, low inference latency, and moderate resource consumption. These results confirm the feasibility of deploying intelligent intrusion detection mechanisms on edge devices, contributing to more secure and resilient IoT infrastructures.

Article Details

How to Cite
Sebastião Galdino, R., Lucas Silva Santos, V., Zegarra Rodríguez, D., Lopes Rosa, R., & de Lima Salgado, A. (2025). From Risk to Protection: Smart Threat Detection in IoT Using Machine Learning. INFOCOMP Journal of Computer Science, 24(2). Retrieved from https://infocomp.dcc.ufla.br/index.php/infocomp/article/view/5358
Section
Machine Learning and Computational Intelligence

References

[1] Alsharif, N. A., Mishra, S., and Alshehri, M. IDS in IoT using machine learning and blockchain. Engineering, Technology & Applied Science Research, 13(4):11197–11203, 2023.

[2] Barbosa, R., Ogobuchi, O. D., Joy, O. O., Saadi, M., Rosa, R. L., Al Otaibi, S., and Rodríguez, D. Z. IoT based real-time traffic monitoring system using images sensors by sparse deep learning algorithm. Computer Communications, 210:321–330, 2023.

[3] Bhavsar, M. H., Bekele, Y. B., Roy, K., Kelly, J. C., and Limbrick, D. FL-IDS: Federated learning-based intrusion detection system using edge devices for transportation IoT. IEEE Access, 12:52215–52226, 2024.

[4] Carrillo, D., Kalalas, C., Raussi, P., Michalopoulos, D. S., Rodríguez, D. Z., Kokkoniemi-Tarkkanen, H., Ahola, K., Nardelli, P. H., Fraidenraich, G., and Popovski, P. Boosting 5G on smart grid communication: A smart RAN slicing approach. IEEE Wireless Communications, 30(5):170–178, 2022.

[5] Carvalho Barbosa, R., Shoaib Ayub, M., Lopes Rosa, R., Zegarra Rodríguez, D., and Wuttisittikulkij, L. Lightweight PVIDNet: A priority vehicles detection network model based on deep learning for intelligent traffic lights. Sensors, 20(21):6218, 2020.

[6] de Sousa, A. L., OKey, O. D., Rosa, R. L., Saadi, M., and Rodriguez, D. Z. Unified approach to video-based AI inference tasks in augmented reality systems assisted by mobile edge computing, 2023.

[7] dos Santos, M. R., Batista, A. P., Rosa, R. L., Saadi, M., Melgarejo, D. C., and Rodríguez, D. Z. ASQM: Audio streaming quality metric based on network impairments and user preferences. IEEE Transactions on Consumer Electronics, 69(3):408–420, 2023.

[8] Fonseca, D., da Silva, K. C. N., Rosa, R. L., and Rodríguez, D. Z. Monitoring and classification of emotions in elderly people. In 2019 International Conference on SoftCOM, pages 1–6. IEEE, 2019.

[9] Haji, S. H. and Ameen, S. Y. Attack and anomaly detection in IoT networks using machine learning techniques: A review. Asian Journal of Research in Computer Science, 9(2):30–46, 2021.

[10] Kaushik, S., et al. Robust machine learning based intrusion detection system using simple statistical techniques in feature selection. Scientific Reports, 15(1):3970, 2025.

[11] Malathi, C. and Padmaja, I. N. Identification of cyber attacks using machine learning in smart IoT networks. Materials Today: Proceedings, 80:2518–2523, 2023.

[12] Matthew, U. O., et al. Software-defined networks in IoT ecosystems for renewable energy resource management, 2024.

[13] Okey, O. D., Maidin, S. S., Adasme, P., Lopes Rosa, R., Saadi, M., Carrillo Melgarejo, D., and Zegarra Rodríguez, D. BoostedEnML: Efficient technique for detecting cyberattacks in IoT systems using boosted ensemble ML. Sensors, 22(19):7409, 2022.

[14] Okey, O. D., Rodriguez, D. Z., and Kleinschmidt, J. H. Enhancing IoT intrusion detection with federated learning-based CNN-GRU and LSTM-GRU ensembles. In 2024 ISWCS, IEEE, 2024.

[15] Pinto, G. E., Rosa, R. L., and Rodriguez, D. Z. Applications for 5G networks. INFOCOMP Journal of Computer Science, 20(1), 2021.

[16] Rahman, M. M., Shakil, S. A., and Mustakim, M. R. A survey on intrusion detection system in IoT networks. Cyber Security and Applications, 3:100082, 2025.

[17] Rezaie, V., et al. Speech emotion recognition using ANFIS and PSO optimization with Word2Vec. Research Square, 2022.

[18] Ribeiro, D. A., Melgarejo, D. C., Saadi, M., Rosa, R. L., and Rodríguez, D. Z. A novel DDPG model applied to ITS security in 5G and 6G. Physical Communication, 56:101938, 2023.

[19] Ribeiro, D. A., et al. Light field image quality enhancement by lightweight deep learning. Electronics, 10(10):1136, 2021.

[20] Rodríguez, D. Z. and Möller, S. Speech quality parametric model considering wireless networks. QoMEX 2019.

[21] Rosa, R. L., Rodriguez, D. Z., and Bressan, G. Sentimeter-BR: Social web analysis tool. IEEE MDM 2013.

[22] Silva, D. H., Maziero, E. G., Saadi, M., et al. Big data analytics for critical information classification in OSN. Peer-to-Peer Networking and Applications, 15(1):626–641, 2022.

[23] Silva, D. H., Rosa, R. L., and Rodriguez, D. Z. Sentimental analysis of soccer game messages. INFOCOMP, 19(1), 2020.

[24] Teodoro, A. A., Gomes, O. S., Saadi, M., et al. FPGA-based evaluation of ANN for IoT. Wireless Personal Communications, 127(2):1085–1116, 2022.

[25] Teodoro, A. A., et al. Skin cancer classification using GAN and attention. Journal of Signal Processing Systems, 95(2):211–224, 2023.

[26] Teodoro, A. A., et al. Image feature extraction for COVID-19 classification using CNNs. Journal of Signal Processing Systems, 2023.

[27] Terra Vieira, S., Lopes Rosa, R., Zegarra Rodriguez, D., et al. Q-meter. Sensors, 21(5):1880, 2021.

[28] Ugochukwu, O. M., Rosa, R. L., Adenike, O. O., and Rodriguez, D. Z. Advancing cybersecurity of sensitive healthcare data. INFOCOMP, 23(2), 2024.

[29] Ugochukwu, O. M., Rosa, R. L., Adenike, O. O., and Rodriguez, D. Z. Distributed healthcare privacy protection. INFOCOMP, 23(2), 2024.