To address the problems of complex environment, limited device computational resources and limited memory resources in the existing IoT, SELSTM, an intrusion detection system composed of NSENet and LSTM fusion based on SENet, is investigated. The NSENet part of the SELSTM system is based on the squeeze-and-excitation network (SENet). The lightweight computational modules NonLocal, SKConv and inverted residuals are fused into SE blocks, and self-attention of Nonlocal is used to improve the local receptive field of feature extraction. The channel attention and spatial attention of each part of the data are strengthened by the use of SKConv To enhance the adaptive convolution ability of the model and ensure the completeness of the information, the properties of the inverted residual structure are used to ensure that the gradient of the model decreases steadily without gradient explosion or disappearance. For the problem of data imbalance, the dataset is randomly resampled using the weight resampling technique to improve the balance of the dataset to ensure that the final detection effect of the model is more effective and generalized, while the data flow is divided into two parts for processing, and the model parameters are optimized using the model gradient optimizer consisting of the optimizer Lion and the optimization function Lookahead. The model extracts the spatial and temporal features of the data through multidimensional extraction to ensure the completeness of the data feature information in multiple dimensions, thus obtaining better detection results. The results of the experiments comparing the SELSTM model with other models on the intrusion dataset show that the intrusion detection model has a higher detection precision and accuracy than the traditional deep learning intrusion detection model, which indicates that the SELSTM has better detection performance properties and better practicality and effectiveness on IoT devices.