Rip Current Detection

Hi, I’m wondering how to train a Neural Network to detect whether an image has a rip current. Can anyone help me with the feature selection and training process?

Hey SaiVignesh,
How far along did you get with this? Still need some help?

Yes, I need your help. Thank You, Mr Graham Broughton

Well, the first bit to a project like this is obtaining the data. I’m not very familiar with rip current but would it be hard to tell from a picture… would video be better maybe?

Once you have your data, i’d say like bare minimum a few hundred of each yes and no’s, then you will need to annotate them. This just means drawing a rectangle around where the rip current is and saving the coordinates of the rectangle to a file.

After that you can just train a YOLO model on the data and if the accuracy is good enough for you your done! If not, you can look at the results to try and figure out where the model needs improving.

1 Like

Notice that the OP only asked about classification, not localization

in which case choosing YOLO is likely not optimal. First, YOLO does localization, which may not be needed. Second, YOLO supports multiple objects per image, which is also seems unlikely to be needed - how many rip currents could be captured in a single image? Third, YOLO is very challenging to train from scratch because of the large number of trainable parameters; YOLO requires a lot of data and a lot of computation. Finally, it seems unlikely to me that there are YOLO models pretrained on ocean images to leverage, either as-is or in transfer learning.

My suggestion would be to work with a much simpler CNN architecture that outputs binary classification of rip/not rip, though more elaboration of the project objectives would help confirm that. HTH

Here’s a link that generates a set of rip current pictures using Google interweb search:

https://www.google.com/search?tbs=simg:CAEShgIJBBi-EAmSv5Qa-gELELCMpwgaOwo5CAQSFK0K_1R2UFasLwAOhGe8EmgaOELYOGhsoS8mqrmgP77R8HEiBwZQdci4VqRTO0P2v604gBTAEDAsQjq7-CBoKCggIARIEOACPwAwLEJ3twQkamQEKGwoHY3VycmVudNqliPYDDAoKL20vMGNuOXAyMgoeCgpzZWFjaGFubmVs2qWI9gMMCgovbS8wY25ta2wwChoKB3NoYWxsb3fapYj2AwsKCS9hL2Jtd3F5bAodCglvdmVyZmFsbHPapYj2AwwKCi9tLzBjbjlwY18KHwoLc2FsdCBzcHJpbmfapYj2AwwKCi9tLzBjbjlzZ24M&q=rip+current&tbm=isch&sa=X&ved=2ahUKEwjqtaPluLP-AhXTkIkEHQqzAm8Q7Al6BAgJEAg&biw=1024&bih=726&dpr=2

I notice that there are a few pictures with more than one. Question to the OP is whether that is important or it is enough to classify this correctly as rip current present eg to post a warning at the beach.

1 Like

Notice this one in particular, which is doing localization:

Rip Currents: The AI-Powered Technology That Could Save Lives

More information here:

1 Like

Wow, this is a really cool application! My wife was nearly killed by a rip current as a child, thankfully a lifeguard was able to save her.

While this seems like a super awesome application of AI, most ideas like this seem to die when they hit real life because the business model isn’t understood. It’s not obvious how this would be used aside from the proof of concept. Mobile app that alerts you based on GPS coordinates of user and the riptide (seems far-fetched but I guess it could work)? Cameras mounted on parking lot poles all along the beach and relayed to electronic signage? Who pays for it, the city/taxpayer? etc. etc.

If you are working on this problem for real (and not just wanting practice), you might considering having good answers to all those questions first. Good luck!