AI technology could soon save lives at the beach. Here's how.