Gray whales have become a more common sight in San Francisco Bay, with their spouts appearing off Alcatraz Island in one of the nation’s busiest waterways. The animals are detouring from their annual migration between Mexico and Alaska to feed in the bay’s waters, researchers said, a shift driven by declining food availability in the Arctic as sea ice shrinks and the ecosystem changes.

The change has put the whales in the path of ship traffic. Of the 16 gray whales documented in the bay this year, seven have died, according to researchers at the Marine Mammal Center and the California Academy of Sciences, who conducted animal autopsies on the carcasses. Broken bones and bruised tissue on several of the whales indicated blunt force trauma from vessel strikes, said Kathi George, director of Cetacean Conservation Biology at the Marine Mammal Center. She said one female that entered the bay this year died from injuries caused by a ship strike.

The deaths come amid a broader population decline for North Pacific gray whales, which number roughly 13,000 — half the population of a decade ago, scientists said. Last year, 22 gray whales died in the larger San Francisco Bay Area, the highest number in 25 years, according to researchers.

“We’re looking at a moment for gray whales where every whale that comes in and goes out of the bay matters for population,” said Douglas McCauley, director of the Benioff Ocean Science Laboratory at the University of California Santa Barbara. “So even though this is just one piece of the problem, it’s a piece that we want to solve, can solve.”

To address the immediate threat, a coalition of marine scientists, the U.S. Coast Guard, and a technology company called WhaleSpotter have installed a thermal camera on a tower in the middle of the bay. The camera detects the heat of whale exhalations — their blows — which are slightly warmer than the surrounding air and water. The images are screened by artificial intelligence and then confirmed by human reviewers, said Shawn Henry, CEO of WhaleSpotter. Once a whale’s position is identified, it is posted on the WhaleSafe website, run by UCSB’s Benioff Ocean Science Laboratory, and the Coast Guard alerts vessels over the radio.

“We want the word to get out,” said Gary Reed, director of Vessel Traffic Service San Francisco for the U.S. Coast Guard. “We want people to know there are whales in a particular location so they don’t encounter them.”

Before the new system, Coast Guard alerts relied on visual reports from vessels during daylight hours, Reed said. The thermal camera provides nighttime detection capability. An additional camera is being installed on a local ferry. The Bay Area’s two ferry companies have said their operators either slow down or navigate around areas where whales have been sighted, researchers said. Larger container ships, which are less maneuverable and confined to designated shipping lanes, face greater challenges.

For now, vessel participation in avoiding whales is voluntary. McCauley noted that on other parts of the California coast, shipping fleets have shown significant compliance with voluntary speed limits without mandatory regulations.

“I’m really optimistic that this is one of those solutions where the community comes together, and the community solves it, but we’ll see,” McCauley said.

Gray whales undertake one of the longest migrations of any mammal, traveling about 12,000 miles roundtrip each year. They spend summers feeding in the cold Arctic waters, where abundant prey — tiny, shrimp-like animals — fuels the journey. Climate change has reduced sea ice in the Arctic, one of the fastest-warming regions on Earth, altering the ecosystem and diminishing the availability of their prey. Gray whales need to eat more than a ton of prey per day, scientists said.

“These whales are hungry,” George said. “We think they’re stopping at different areas along their route to find sources of food, and San Francisco Bay has become one of those hotspots.”

Researchers said conditions for gray whales may become more challenging as the climate continues to change. McCauley said the whales are showing an ability to adapt, but it may have limits.

“The world is changing, they’re trying their best to change themselves,” he said. “The one thing they’re not doing is quitting.”