| Rip currents are common natural hazard on beaches,widely distributed around the world.Which can swiftly pull swimmers into deeper waters,leading to safety accidents.Rip currents often have sudden and concealed characteristics,making it challenging for inexperienced beach managers and tourists to identify them,posing significant risks to swimmers and boats.Although deep learning is a popular technology in the field of computer vision,its application in rip current recognition is currently limited,and stable detection of rip currents is difficult to achieve.This thesis conducts innovative research on rip current detection based on deep learning.(1)A homemade rip current dataset was created through aerial photography,and the improved rip current recognition methods was proposed for YOLOv5 s.Firstly,a JDC(Joint Dilated Convolution)module was designed to solve the problem of a significant increase in parameter quantity or feature information loss when expanding the receptive field,improving feature information utilization.Then,a parameter-free attention mechanism,SimAM module,was added to enhance effective feature processing ability and improve detection accuracy while maintaining the same number of parameters.Finally,the small object detection scale branch was removed,and the connection channels of the original network were reconstructed with improved modules to reduce the overall model complexity and improve detection speed.Experimental results showed that compared with the original model,the improved YOLOv5 s model had an mAP value of 93.27%,which was 4.38% higher on the same dataset,and the detection frame rate increased by 2.52 frames per second,while the model size only increased by 0.45 MB.Compared with several mainstream models,the improved model not only had a simplified structure but also significantly improved detection accuracy,indicating that the model has accuracy and efficiency in detecting rip currents and can provide an effective approach for accurate target detection in embedded devices.(2)When detecting rip currents in video format,the diverse and indistinct boundaries of rip currents lead to unstable detection results in terms of size and position between frames,causing severe jitter of prediction boxes in the video.In addition,the influence of waves can cause missed and false detections in some image frames.In this thesis,a new method for stable prediction boxes is proposed by combining the K-means algorithm for partitioning clustering and integrating it with the data processing module at the output end of YOLOv5 s.The method involves grouping the prediction box clusters based on the number of image frames,obtaining the cluster center,and performing full coverage on the prediction box data within the group.Experimental tests showed that this method not only eliminates false detections and increases the prediction box data of missed detections but also stabilizes the prediction boxes and clearly displays the rip current areas and sizes in the video.(3)In order to test the final detection performance of the model and verify its practicality,a rip current information analysis system based on the Java framework SpringBoot was built.The frontend takes images or videos as input,and the backend performs detection to generate the position coordinates of the prediction box,the area ratio of the prediction box area,and other detection data.This system can conveniently display and record the detection results,providing valuable information for subsequent rip current research. |