NOTEBOOK FEATURE: How AI can help protect California streams and fish

by Robin Meadows 

Rivers in California once swelled and ebbed as the seasons changed and as wet years gave way to dry ones. Salmon and other now-imperiled aquatic species depended on these historic patterns. But today dams and diversions have altered most of the state’s waterways, leaving their natural flows a mystery.

“Natural flows have been a longstanding question in water management, especially for fish,” says Kirk Klausmeyer, who directs data science for The Nature Conservancy in California. “To restore stream habitats, we need to try and replicate natural flows—but we don’t have the data.”

Only about 10% of California’s rivers have stream gauges. Luckily, though, a few rivers both have gauges and are still essentially free flowing. Data from this handful of rivers can be used to predict the natural flows in altered streams had they been left untouched. But people crunch these numbers quite slowly.

HOW MACHINE LEARNING PREDICTS NATURAL STREAMFLOWS

A DWR water resources technician fine-tunes equipment for a stream gauge in Honcut Creek in Butte County. Photo by DWR.

A type of artificial intelligence called machine learning can predict natural flows much faster―and more accurately. Machine learning sifts through reams of data to find patterns, letting computers solve problems based on experience much as people do.

“That’s what machine learning is good at,” Klausmeyer says. “It can take a clean dataset of natural streamflows and build a model that can expand to all rivers in California.”

The Nature Conservancy partnered with the U.S. Geological Survey and others to make a machine learning model of natural flows in California streams. The team used 90% of the free-flowing stream data to train the model, and the remaining 10% to test its accuracy. “That’s how you check your work,” Klausmeyer says.

A 2017 study he co-authored found that their machine learning model “predicted these actual flows very well,” with a median accuracy of 80%. The team then used the model to create the California Natural Flows Database, an open-access web platform that estimates how much water all the state’s streams and rivers would have had if they were still free flowing.

USING NATURAL FLOWS TO PROTECT AQUATIC SPECIES

Applying the model statewide helped reveal priorities for river protection and restoration. While most California rivers face altered flows, some also still have free-flowing stretches. “It’s very important to protect the watershed upstream and minimize alterations in these places,” Klausmeyer says.

The Smith River on the north coast is one of California’s few remaining free-flowing waterways. Photo by David Berry/Flickr

Another set of rivers has natural flows except during the summer growing season, when farmers divert lots of water. These diversions can threaten fish and other aquatic species because many streams already run low during California’s hot, dry summers. “We’re working to shift when farmers take water out,” Klausmeyer says. “They can take water out during the wet season and store it in tanks for the dry season.”

Other users of the California Natural Flows Database include the California Department of Fish and Wildlife’s Instream Flow Program, which determines the flows required to keep conditions healthy for species living in or along waterways. This can inform how much water the State Water Resources Control Board allows users to divert from streams.

“In the most recent drought emergency, we were able to use the Natural Flows Database to evaluate flows in stream reaches that have historically lacked sufficient data and information,” says Brionna Drescher, an environmental scientist with the Instream Flow Program.

Drescher and colleagues shared how they use the California Natural Flows Database at a recent workshop for fish and wildlife agencies across the West. “Streamflow gauge data is inadequate in many western states,” she says.

Powerful as the California Natural Flows Database is, however, it only yields monthly averages or—as Klausmeyer puts it—“just 12 data points per year.” Predicting details like peak flows and the length of dry spells requires a model of daily flows, which is beyond the reach of the type of machine learning that underlies the California Natural Flows Database.

Klausmeyer is now collaborating with environmental software company Upstream Tech to build an AI model of daily natural streamflows in California, and Drescher sits on the effort’s technical advisory group.

HOW NEURAL NETWORKS PREDICT DAILY NATURAL FLOWS

The new daily flow model uses a neural network, the type of machine learning that underpins ChatGPT, the generative AI that can answer questions, summarize text, write computer code, and much more.

Schematic of how neural networks predict streamflows. Figure by Upstream Tech.

“Neural networks are a very flexible and powerful type of machine learning,” says Alden Sampson, Upstream Tech’s co-founder and chief technology officer. “They’re loosely inspired by how our brains work.” Just as the strength of connections between neurons leads to learning in people, the strength of connections between data processing units leads to learning in AI neural networks.

Traditional flow models rely on equations that predict how much water enters streams based on measured inputs like rainfall, temperature and soil moisture. But, as Sampson points out, “when it comes to streamflow, we scientists don’t have the best equations.” The neural network model starts with much the same inputs as traditional models but does a better job predicting the outputs.

Like the machine learning model of monthly natural flows, the neural network model learned to predict daily natural flows by pairing the inputs with known flows from relatively unaltered streams. Sampson puts it this way: “You give it the inputs and the outputs and say ‘I want you to look at this large data set and figure out how the inputs lead to the outputs.’”

“This is where the neural network really shines—it teases out the nuances of all the complex interactions that affect streamflow,” Sampson continues, adding that he expects the daily natural streamflow model to be complete in about a year.

Klausmeyer’s team will then incorporate these daily flow estimates into the Natural Flows Database and publish them online. One of the most pressing applications is tracking natural peak flows during wet years, when streams run high and can overflow.

“There’s a lot of interest in diverting all the peak flows in wet years,” Klausmeyer says. “While this can be a good strategy to minimize floods and recharge groundwater, removing all the peak flows will harm ecosystems.”

The new neural network model of daily flows will help ensure that these water diversions don’t come at the expense of at-risk species living in streams. “Anyone can access this information rapidly from their desktop,” Drescher says. “Machine learning makes this an exciting time.”

Print Friendly, PDF & Email