Abstract:In addressing the issues of detection accuracy and resource consumption in IoT intrusion detection methods, an IoT attack detection method based on ensemble learning lightweight gradient boosting machine (LightGBM) and random forest (RF) models is proposed. Grid search (GS) and heuristic algorithms are used to tune the hyperparameters of the models, and the synthetic minority over-sampling technique (SMOTE) is employed for data augmentation to address the imbalance in IoT dataset labels. Experimental results show that after applying the SMOTE technique, the grid search-light gradient boosting machine (GS-LightGBM) model achieves an accuracy of 99.91% and performs excellently on imbalanced datasets. In terms of resource consumption, the genetic algorithm-random forest (GA-RF) model achieves an accuracy of 99.88%, with an average inference time at the microsecond level and memory usage of less than 1kB during inference, enabling efficient operation on most resource-constrained IoT devices.