Walid Alayash, Maha Rahrouh, Amer Abbas Ibrahim, Marwa Hussien Mohamed, Saja Theab Ahmed, Mazen Hamed Albarri, Mohammed Hasan Ahmed
The rapid expansion of the Internet of Things (IoT) has transformed modern connectivity, allowing seamless communication and data exchange between devices and systems. Nevertheless, with this increased interconnectivity comes significant cybersecurity problems, subjecting IoT infrastructures to diverse and complex cyber attacks. Therefore, developing smart intrusion detection mechanisms is now essential to ensure the integrity of data, privacy, and network trustworthiness in IoT settings.The deep learning models Gated Recurrent Unit (GRU) and Long Short-Term Memory (LSTM) are evaluated in this study with respect to their capacity to detect IoT cyberattacks. Three new datasets—NF-ToN-IoT, UNSW_NB15, and BoT-IoT—were employed with the preprocessing of missing value treatment, encoding categorical variables, normalization of features, and a 70/30 train-test data split. The outcome reveals excellent performance in both models with 100% accuracy on the BoT-IoT dataset. For UNSW_NB15 data, the accuracy of GRU was 97% compared to LSTM's 96%, while LSTM (83%) was slightly better than GRU (81%) for NF-ToN-IoT. These outcomes signify the stronger ability of recurrent models to handle the complexity of IoT data and strengthen the argument that model selection is based on specific features of datasets. It should be explored in future research using hybrid and transformer-based architectures to enhance emerging threat detection. Further to this, this work offers immense educational importance by presenting a practical guide towards educating students on applying deep models such as LSTM and GRU to secure IoT systems using empirical evidence and experiments in the laboratory.