This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Open AccessArticle
Enhancing IoT Security with Generative AI: Threat Detection and Countermeasure Design
1
Department of Computer Science and Media Technology, Malmö University, 205 06 Malmö, Sweden
2
Sustainable Digitalisation Research Centre, Malmö University, 205 06 Malmö, Sweden
*
Author to whom correspondence should be addressed.
Electronics 2026, 15(1), 92; https://doi.org/10.3390/electronics15010092 (registering DOI)
Submission received: 18 November 2025
/
Revised: 17 December 2025
/
Accepted: 22 December 2025
/
Published: 24 December 2025
Abstract
The rapid proliferation of Internet of Things (IoT) devices has increased the attack surface for cyber threats. Traditional intrusion detection systems often struggle to keep pace with novel or evolving threats. This study proposes an end-to-end generative AI-based intrusion detection and response pipeline designed for automated threat mitigation in smart home IoT environments. It leverages a Variational Autoencoder (VAE) trained on benign traffic to flag anomalies, a fine-tuned Bidirectional Encoder Representations from Transformers (BERT) model to classify anomalies into five attack categories (C&C, DDoS, Okiru, PortScan, and benign), and Grok3—a large language model—to generate tailored countermeasure recommendations. Using the Aposemat IoT-23 dataset, the VAE model achieves a recall of 0.999 and a precision of 0.961 for anomaly detection. The BERT model achieves an overall accuracy of 99.90% with per-class F1 scores exceeding 0.99. End-to-end prototype simulation involving 10,000 network traffic samples demonstrate a 98% accuracy in identifying cyber attacks and generating countermeasures to mitigate them. The pipeline integrates generative models for improved detection and automated security policy formulation in IoT settings, enhancing detection and enabling quicker and actionable security responses to mitigate cyber threats targeting smart home environments.
Share and Cite
MDPI and ACS Style
Oacheșu, A.; Adewole, K.S.; Jacobsson, A.; Davidsson, P.
Enhancing IoT Security with Generative AI: Threat Detection and Countermeasure Design. Electronics 2026, 15, 92.
https://doi.org/10.3390/electronics15010092
AMA Style
Oacheșu A, Adewole KS, Jacobsson A, Davidsson P.
Enhancing IoT Security with Generative AI: Threat Detection and Countermeasure Design. Electronics. 2026; 15(1):92.
https://doi.org/10.3390/electronics15010092
Chicago/Turabian Style
Oacheșu, Alex, Kayode S. Adewole, Andreas Jacobsson, and Paul Davidsson.
2026. "Enhancing IoT Security with Generative AI: Threat Detection and Countermeasure Design" Electronics 15, no. 1: 92.
https://doi.org/10.3390/electronics15010092
APA Style
Oacheșu, A., Adewole, K. S., Jacobsson, A., & Davidsson, P.
(2026). Enhancing IoT Security with Generative AI: Threat Detection and Countermeasure Design. Electronics, 15(1), 92.
https://doi.org/10.3390/electronics15010092
Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details
here.
Article Metrics
Article metric data becomes available approximately 24 hours after publication online.