Is a robot coming for your job?

That is more likely for Californians who work in Riverside, San Bernardino, Merced or Modesto, according to a report released this month by the Brookings Institution. Those who live in San Francisco or San Jose have a better chance of weathering a coming onslaught of automation and artificial intelligence.

The new study by the Washington think tank suggests that intelligent machines may well take over many more tasks from humans in the future. But it forecasts dramatic differences among cities, occupations, ethnic and racial groups, educational levels and age groups.

"California turns out to have super-stark variations -- regions with both the highest and lowest exposures to disruption," said Mark Muro, director of Brookings' Metropolitan Policy Program and author of the report along with researchers Robert Maxim and Jacob Whiton.

The Brookings study comes as a slew of academic and policy group papers have sought to predict the workforce effects of a rapid revolution in robotics, machine learning and artificial intelligence. Fields such as manufacturing and clerical work have already experienced extensive automation, shrinking the number of middle-class jobs. But as technology becomes less expensive and more sophisticated, it is spreading into the low-wage service economy.

Robots take over the tasks of warehouse laborers and farmworkers. Restaurant patrons can order from menus on tablets. Hotels are experimenting with self-check-in kiosks and robot room-service -- a trend that fueled recent strikes by Marriott workers.

The 107-page report suggests that although the last 25 years of automation hollowed out middle-skill employment in factories and offices, the next 15 years will have far more effect on low-skill jobs. And it calls for a major restructuring of schools and universities, stepped-up in-house training by business and ambitious government investment to strengthen the safety net for workers who lose their jobs.

"Looking back, there was no overall job apocalypse," Muro said. "From 1980 to 2016, the economy created 54 million net new jobs. But the distribution changed: We lost a lot in the middle and saw a massive shift of American workers into low-skill employment."

Recent automation has exacerbated inequality, said the report, which maps the nation's 3,141 counties and 381 metropolitan areas according to the likely number of jobs vulnerable to disruption. "Gains have come predominantly at the low and high ends of the scale, and those have become more pronounced over time," it said.

Over the next few decades, about a quarter of U.S. jobs will be highly exposed to automation, which the report defines as jobs for which 70 percent of tasks can be performed by machines. An additional 36 percent of jobs will experience "medium exposure," defined as affecting 30 percent to 70 percent of tasks. The rest of the workforce would be less vulnerable.

"That one-quarter of American jobs will be seriously disrupted is sobering," the report said. But it added that it was "somewhat reassuring ... that just half of a percent of the workforce (740,000 people) labor in roles that are 100 percent automatable."

The most vulnerable jobs are those requiring less than a bachelor's degree. In warehouses such as those in California's Inland Empire, 100 percent of tasks performed by packaging and filling machine operators may be automated, the report suggests. In food preparation, 91 percent of tasks are considered to be vulnerable. The tasks of more than half of payroll and timekeeping clerks, delivery drivers, computer network support specialists and medical assistants could be automated.

However, some low-paid workers have hard-to-automate jobs: just 11 percent of the work done by home health aides, and just 18 percent of maids' work is vulnerable.

Among the better-paid, just 4 percent of management analysts' tasks and 8 percent of software developers' are likely affected, the study found.

The Brookings report builds on a 2017 study by McKinsey Global Institute, "A Future That Works: Automation, Employment, and Productivity," which analyzed automation in 800 occupations.

Brookings combined that data with information on the geographic and demographic distribution of jobs.

"California is a microcosm of the nation in that it runs the gamut," Muro said. "You have the classic coastal 'superstars,' with low automation exposure, and your own 'heartland,' like areas of the Midwest, with elevated exposure."

High math and computer employment in San Francisco and San Jose contrast with high farming employment in Stockton, Fresno and Modesto. Los Angeles, Muro said, resembles the Bay Area but has more office, factory and transportation jobs, which are vulnerable to automation. At the same time, he noted, Los Angeles' large entertainment and creative sector makes it more resilient than inland areas.

Education levels across the U.S. and California correlate with the likelihood of automation. About half of the workers in San Jose and San Francisco have bachelor's or graduate degrees, Muro noted, compared with about a third in Los Angeles and about a fifth or less of the workforces in Fresno, Stockton and Modesto.

Differences in employment along gender, age, race and ethnicity lines influence which groups are most susceptible to the effects of automation.

The report finds that on average 43 percent of tasks done by men and 40 percent by women are vulnerable because men are more likely to hold factory, transportation and construction jobs -- all with more automatable tasks.

Among workers under age 24, about half are in jobs that are subject to automation, compared with about a third of workers 25 and older.

Workforce segregation also means that on average 47 percent of tasks performed by Hispanics, 44 percent by African Americans, 40 percent by whites and 39 percent by Asians are vulnerable to automation.