Your trip to the beach could someday be a lot safer, thanks to artificial intelligence.

Researchers at the University of California Santa Cruz, led by Professor Alex Pang, are developing potentially life-saving AI algorithms geared toward detecting and monitoring potential dangers along the shoreline, according to the Santa Cruz Sentinel.

The life-saving technology could also alert lifeguards of potential hazards and detect rip currents or riptides, which, according to water rescues and safety expert Gerry Dworkin, account for 80% of ocean lifeguard interventions.

WHAT IS ARTIFICIAL INTELLIGENCE (AI)?

New York beach

Flags warn that the beach is closed to swimmers at Rockaway Beach in New York as high surf from Hurricane Franklin delivers strong rip tides and large waves to most of the eastern seaboard in New York City on Aug. 31. (Spencer Platt/Getty Images)

Pang told the outlet that the inspiration for the technology came while windsurfing with friends when he realized just how difficult rip currents are to spot with an untrained eye.

"They would point out a rip, and I would look in the water and say, ‘That’s just water,’" he said.

According to the National Weather Service, rip currents move sand, organisms and other materials offshore. Safety experts typically encourage people caught in the current to swim parallel to the shore instead of fighting against it, but water dangers can prove deadly in many cases, so prevention is often key.

Experts, including Chris DeJong, a former national champion swimmer and the Atlanta-based founder of the Big Blue Swim School, also urge beachgoers to watch out for flag warnings, with yellow meaning rip currents are expected and red meaning a "dangerous" rip current is expected.

NSA ANNOUNCES NEW ARTIFICIAL INTELLIGENCE SECURITY CENTER: ‘DESPERATELY NEEDED’

Rip Current Graphic

This graphic from the National Weather Service shows what to do if you are caught in a rip current. The best way to escape is to swim parallel to the shore out of the current's flow. If possible, always swim near a lifeguard.  (U.S. National Weather Service)

For the AI research, Pang and other researchers partnered with National Oceanic and Atmospheric Administration (NOAA) scientist Gregory Dusek, who, according to the agency, developed a forecast model to predict the hourly probability of rip currents for up to six days out.

Pang's detection model is said to improve upon the existing model to offer real-time rip current detection using technology that will continuously improve its recognition abilities over time.

The machine learning technology, which, according to MIT, is a "subfield" of AI geared toward allowing technology to "learn without explicitly being programmed," allowed Pang and his team to essentially "train" the algorithm using images so that it can learn to detect rip currents.

Lifeguards can use this information to save lives.

PANAMA CITY BEACH IS THE DEADLIEST BEACH IN AMERICA IN 2023

A lifeguard looks out at people swimming

Swimming near a lifeguard is one of the best ways to ensure safety during a day at the beach. (Gary Hershorn/Getty Images)

"Ideally, the system will send alerts to lifeguards only if there are people detected in the rip. If necessary, it can distinguish between people and surfers," he explained, according to the Sentinel report.

AI has been used to help enhance water safety in other ways as well. One local report, for example, followed a YMCA location in Ann Arbor, Michigan, that used tech from Israeli company Lynxight to detect swimmers in distress in its aquatic center to help prevent drownings.

CLICK TO GET THE FOX NEWS APP

Fox News' Christine Rousselle contributed to this report.