Rip currents are common natural disaster and widely distributed on beaches around the world, which can quickly bring swimmers into deep water and cause safety accidents. Rip currents are generally sudden and insidious, making it difficult for inexperienced beach managers and tourists to identify them, and presenting a high risk to swimmers. Deep learning is a popular technology in the field of computer vision, but its applications in rip currents recognition are rare, and it is difficult to realize real-time detection of rip currents. In response to the above problems, we propose an improved YOLOv5s rip currents identification method. Firstly, a joint dilated convolution module is designed to expand the receptive field, which not only improves the utilization of feature information, but also effectively reduces the amount of parameters. Then, a parameter-free attention mechanism module is added, which does not increase the complexity of the model and can improve the detection accuracy at the same time. Finally, the Neck area of the original YOLOv5s model is simplified, the 80x80 feature map branch suitable for detecting small targets is deleted, and the overall complexity of the model is reduced by reducing the amount of parameters to improve the real-time detection. We have conducted multiple sets of experiments on public data set. The results show that compared with the original YOLOv5s model, the mAP of the improved model for identifying rip currents on the same data sets has increased by 4%, reaching 92.15%, and the frame rate has increased 2.18 frames per second, and the model size is only increased by 0.45 MB. Compared with several mainstream models, the improved model not only has a simplified structure but also significantly improves the detection accuracy, indicating that our model has the accuracy and efficiency in detecting rip currents, and can provide an effective way for embedded devices to perform accurate target detection.