To detect passengers'abnormal behavior in real time,we propose a lightweight escalator passenger'abnormal behavior real-time detection algorithm,YOLO-STE,based on YOLOv5s.First,a lightweight ShuffleNetV2 network was introduced in the backbone network to reduce the number of parameters and its computation.Second,a C3TR module based on Transformer encoding was introduced in the last layer of the backbone network to better extract rich global information and fuse features at different scales.Finally,an SE(Squeeze-and-excitation)attention mechanism was embedded in the feature fusion network of YOLOv5s to better focus on the main information and improve the model accuracy.We developed our dataset and conducted experiments.The experimental results demonstrate that compared with the original YOLOv5s,the mean Average Precision(mAP)of the improved algorithm is 1.9 percentage points higher,reaching 96.1%,and the model size is reduced by 70.8%.Moreover,the improved algorithm's forward propagation time is 39.9%shorter than that of the original YOLOv5s model when deployed and tested on the Jetson Nano hardware.Compared with the original YOLOv5s model,the improved algorithm can better achieve real-time detection of abnormal behavior of escalator passengers,which can better ensure the safety of passengers riding the escalator.