ASAHIKAWA, Japan — Removing the tiny eyes that pockmark potatoes is dull, repetitive and time-consuming work — perfect, it would seem, for robots in a country where the population is declining and workers are increasingly in short supply.
But it’s not so simple.
When a food processing plant that makes potato salad and stews in Hokkaido, Japan’s northernmost island, tried out a robot prototype designed to remove the potatoes’ eyes, the machine was not up to the task.
The robot’s camera sensors were not sensitive enough to identify every eye. While human hands can roll a potato in every direction, the robot could rotate the vegetables on only one axis, and so failed to dig out many of the blemishes that are toxic to humans. Other perfectly good pieces were carved away.
“Fundamentally, it could not do the work to the standard of humans,” said Akihito Shibayama, a factory manager at Yamazaki Group, which operates the plant in Asahikawa, a midsize city in the middle of Hokkaido where 30 workers process about 15 tons of potatoes a day.
Japan, the world’s third largest economy, hopes that robots and other types of automation will help solve its demographic problems and impending labor shortage. That priority is reflected in a government blueprint, dubbed Society 5.0 and repeatedly emphasized by Prime Minister Shinzo Abe.
But businesses are struggling as some jobs that seem ripe for a robotic takeover prove remarkably difficult to outsource to a machine.
Robots can “perform simple tasks but not tasks that require judgment or the ability to evaluate a change in a situation,” said Toshiya Okuma, associate director of global strategy in the robot business division of Kawasaki Heavy Industries, a leading Japanese developer of robotics that has long helped automate car factory assembly lines.
Looking to robots allows Japan to avoid hard choices about immigration, a delicate topic in a country reluctant to let in many outsiders. But it’s also a good cultural fit.
Japan was an early adopter of robots, installing them in car factories starting in the 1970s. And some of the most beloved Japanese touchstones are robots.
Doraemon, a cuddly blue robot cat, stars in a comic book series and one of the country’s longest-running television shows. Astro Boy — or Tetsuwan Atomu in Japan — is a superhero in comics, television shows and movies, a kind of android equivalent of Pinocchio who fights for peace between robots and humans.
Still, however hospitable Japanese businesses have been to robots, they have learned that robots able to perform somewhat sophisticated tasks cost much more than human workers.
So at the factory in Asahikawa, where about 60 percent of the work is automated, many tasks still require the human touch. Workers peel pumpkins, for example, because some skin enhances the flavor of stew. A robot can’t determine just how much skin to shuck off.
Other efforts to use robots or automation have hit snags, in programs ranging from self-driving buses to package-delivering drones or robots that comfort nursing home residents.
A hotel staffed by androids in southern Japan ended up laying off some of its robots after customers complained that they were not as good at hospitality as people.
During a trial of self-driving buses in Oita City, also in southern Japan, one bus crashed into a curb, and officials realized that autonomous vehicles were not quite ready to cope with situations like traffic jams, jaywalkers or cars running red lights.
For decades, Japan has been a leader in the use of robots. It is the world’s largest maker of industrial robots, and once led the globe in the number of robots per employee, said Gee Hee Hong, an economist specializing in Japan at the International Monetary Fund.
More recently, according to the International Federation of Robots, Singapore, South Korea and Germany have overtaken Japan in robots per worker.
Unlike in the West, where employees often view automation as an existential threat, robots in Japan are generally portrayed as friendly forces.
“Real world robots are regarded for the most part as benevolent and as a kind of symbol of an advanced, technologically savvy society,” said Jennifer Robertson, a professor of anthropology at the University of Michigan and author of “Robo Sapiens Japanicus: Robots, Gender, Family and the Japanese Nation.”
“I think the Japanese have been more innovative in thinking about applications of robotics in everyday life,” Ms. Robertson added. “But the hype got in the way of reality.”
Helping drive the interest in robots are concerns about the declining population in Japan, where births are at their lowest level since 1874. Already industries like manufacturing, caregiving, construction and agriculture are starting to run low of workers.
In Japan, “instead of displacing workers, you are simply replacing workers,” said Todd Sneider, deputy division chief for the Japan division of the International Monetary Fund.
In Hokkaido, for example, where there are 1.2 job openings for every working-age resident, recent tests of autonomous driving trucks have not been perceived as a way to get rid of workers since they are already in short supply, prefectural officials say.
Hokuren, a food company that processes beet sugar in northeastern Hokkaido, needs about 250 drivers during the peak fall season to transport 6,000 tons of beets a day from farms and storage facilities to its processing plant.
Because of intense labor shortages this year, Hokuren tested autonomous vehicles manufactured by UD Trucks, a Volvo subsidiary based in Japan. But Hokuren officials say more tests are needed to ensure that vehicles can handle impediments like snowy or icy roads or changes in traffic lights.
Genyou Imai, 48, the owner of a trucking company that regularly supplies drivers to Hokuren, acknowledged that he could not hire enough to meet his clients’ needs and that the autonomous vehicles might free his company up for other kinds of work.
Although Parliament passed a bill last year to grant new visas to foreign workers to help cope with shortages, the government has consistently emphasized robots as more likely saviors.
“So where you would potentially have immigrants doing the jobs, you say, ‘Go make robots,’” said Selma Sabanovic, a professor of cognitive science at Indiana University who was a visiting scholar at the National Institute of Advanced Industrial Science and Technology in Tsukuba, Japan.
Business leaders have expressed doubts that foreigners could quickly solve Japan’s need for workers, in part because of societal resistance.
“Japan has kind of a very pure-blood race,” said Noritsugu Uemura, an executive in charge of government and external relations for Mitsubishi Electric, a leading electronics manufacturer. “I think not only could it take 20 or 30 years, but it will take more like 40 or 50 years to integrate immigrants into Japan.”
“We can’t wait such a long time,” he added.
Robots have helped the Kalm dairy outside Sapporo, Hokkaido’s capital, trim from 15 workers to five. Now eight robots milk more than 400 cows three times a day as jazz piano music plays over loudspeakers in the barn.
Each cow wears a sensor on its collar to signal the robots when it is time for milking. Automated gates corral the animals into stalls where the robots attach suction cups to the cows’ teats. Computers track the volume of milk streaming into tanks.
Jin Kawaguchiya, chief executive of Kalm and a former banker who took over his wife’s family’s dairy business, said that to survive, it had to merge with several other local dairies that were also short of workers.
“The best thing we could do,” Mr. Kawaguchiya said, “was make it into a humanless process.”
Eimi Yamamitsu contributed reporting.