By MICHAEL LIEDTKE, AP Technology Writer

EAST PALO ALTO, Calif. (AP) — Toyota is investing $50 million with Stanford University and the Massachusetts Institute of Technology in hopes of gaining an edge in an accelerating race to phase out human drivers.

The financial commitment announced Friday by the Japanese automaker will be made over the next five years at joint research centers located in Silicon Valley and another technology hub in Cambridge, Massachusetts.

Toyota has hired robotics expert Gill Pratt to oversee research aimed at developing artificial intelligence and other innovations that will enable future car models to navigate the roads without people doing all the steering and stopping.

"We believe this research will transform the future of mobility, improving safety and reducing traffic congestion," said Kiyotaka Ise, a Toyota executive who oversees the company's research and development group.

Unlike some of its rivals in the technology and auto industries, Toyota believes the day when cars are able to drive entirely by themselves is unlikely to arrive within the next decade. The company instead is focusing its efforts on developing technology that can turn a car into the equivalent of an intelligent assistant that recognizes when it should take over the steering when a driver is distracted or automatically play a favorite song when it detects a driver is in a bad mood.

"What if cars could become our trusted partners?" mused Daniela Rus, an MIT professor who will lead the university's research partnership with the automaker.

Major tech companies such as Google and Uber are competing against a range of automakers to make robot cars that will be better drivers than people and save lives by causing fewer accidents.

Google, which runs some of the world's most popular online services, has been working on a fleet of self-driving cars for the past six years. Its goal is to have the cars capable of driving completely on their own by 2020. Ride-hailing pioneer Uber has teamed up with Carnegie Mellon University on a Pittsburgh research center in its quest to build driverless cars.

Toyota Motor Co. has been working on autonomous driving technology for about 20 years, but it was known as "advanced driving support" back in the 1990s, Ise said.

Pratt, a former program manager at the U.S. government's Defense Advanced Research Projects Agency, or DARPA, suspects many people will still want to drive some of the time even when cars are fully equipped to handle the task. He hopes Toyota's research will give the option of relying on computers to do the job when they are stuck in traffic or traveling down a boring stretch of highway. "Our focus today is more on the autonomy of people," said Pratt, who will be based in Silicon Valley.

Under the Toyota partnership, the MIT research center will focus on inventing ways for cars to recognize their surroundings and make decisions that avert potential accidents. If the goals are realized, Toyota might be able to build a car "that is never responsible for a collision," Rus said.

Besides working on recognition technology, the Stanford research center will try to create artificial intelligence programs that study human behavior to learn more about the decision making and reasoning that goes into driving so cars can quickly adjust to potentially dangerous situations. Stanford's research will be led by Fei-Fei Li, director of the university's artificial intelligence laboratory.

Not far away from Stanford, both General Motors Co. and Ford Motor Co. have established offices in Palo Alto, California, in their own quests to make smarter cars.

Meanwhile, just to the south, Google's self-driving cars are regularly cruising the roads of the company's hometown of Mountain View, California, during ongoing testing of the vehicles.

California law still requires humans to be in the self-driving cars to take control in dangerous situations or if something goes wrong. Most of the time, though, Google's self-driving cars are being controlled by a computer. They logged a combined 147,000 miles in autonomous mode from June 3 through Aug. 31, according to Google. The self-driving cars were involved in four collisions that resulted in no major injuries. The robot cars were rear-ended by vehicles driven by people in those accidents.