By Matt Simon
Iâ€™m not what youâ€™d call a coordinated man, so basketball horrifies me. All the dribbling, all the shootingâ€”all while running and dodging people trying to smack the ball out of your hands. Basketball players have to be one with the laws of physics. I am not one with the laws of physics.
Now imagine teaching the machines something as complicated as dribblingâ€”which is exactly what researchers at Carnegie Mellon University and a startup called DeepMotion have done. Using motion-capture technology, theyâ€™ve shown an algorithm generally how humans move when they dribble. Then, thanks to a process called reinforcement learning, a simulated basketball player can teach itself through trial and error how to finely manipulate the ball, both while stationary and while running. Itâ€™s taught itself to expertly do what would thoroughly embarrass an â€¦ underactive type like myself.
The researchers began by putting people in motion-capture suits to watch them dribble. This gave the reinforcement learning algorithms a good head start. You could try to have an avatar learn from scratch: First to stand, then to walk, then to run, then to manipulate a ball. To do that, you give the system a goalâ€”say, move forward as fast as possibleâ€”and it tries movements at random. If the avatar does something that gets it closer to its goal, like combining random movements in order to stand, it gets points. If it does something dumb, it gets dinged. With a point system like this, over time it teaches itself how to run.
Thatâ€™s not a good way to go about it in this case, though. â€œIf you’re trying to do something easy, then maybe you can just explore the space and flail around much like a baby does as it’s sort of figuring out how to grab things and so on,â€� says CMU roboticist Jessica Hodgins, who helped develop the system. â€œBut it doesn’t make sense in this complicated space of doing something that requires as much agility as basketball dribbling.â€�
So instead of starting from scratch, the motion-capture information allows the avatar to mimic a dribbling humanâ€™s body movement. What the researchers couldnâ€™t capture, though, was the ball itselfâ€”it moves too fast, and you canâ€™t stick trackers on it. They had to add the ball into the simulation, and let the avatar play with it through reinforcement learning, or trial and error.
Carnegie Mellon University
Take a look at the GIF above. The avatarâ€™s dribbling starts out awkward at first, but soon improves. â€œYou’re reinforcing the behaviors that you want and then negatively reinforcing the behaviors that you don’t want,â€� says Hodgins. â€œYou’re doing that by running many, many trials and having the system learn through those trials to be more robust to different kinds of situations.â€�
Had the researchers dropped an avatar in simulation with a perfectly tracked ball, that might work fine. But as soon as they changed something about the environment, like the flatness of the court, the avatar would fall to pieces. Conversely, because itâ€™s learning on its own to manipulate the ballâ€”with the boost of already knowing how the rest of its body should be movingâ€”it can then adapt to, say, a court that isnâ€™t perfectly flat. Itâ€™s â€œrobust,â€� as computer scientists say.
Carnegie Mellon University
The adaptable avatar can even learn to dribble as it runs, via the same process. (Above it loses the ball at first, but learns to improve.) And because itâ€™s more flexible to perturbations in its environment, the researchers can give it a digital â€œpushâ€� as it moves across the court, yet still it dribbles. Until, well, it falls on its face, as you can see below.
Carnegie Mellon University
Why exactly would you want to teach avatar basketball players how to dribble, then push them on their faces? For one, this more natural kind of motion could land in basketball video games, which still struggle a bit with locomotion. â€œThe difficulty in current video games in creating realistic basketball movement is there’s no physics in their simulation,â€� says DeepMotion chief scientist Libin Liu, who helped develop the system. â€œThe current state-of-the-art technique is we record a lot of motions, or possibly ask an animator to fix ball trajectory, and then this ball trajectory and movement will be coupled.â€�
This sometimes imperfect marriage leads to quirks like the basketball sticking in an avatar’s hands, or not quite lining up with a playerâ€™s grasp. This avatar, on the other hand, is more grounded in the physical laws of the universe. â€œBecause we are using a physics simulation to generate motions, all the motions are automatic,â€� says Liu. â€œThat means the ball can’t stick on the characters hand because there’s no glue on his hand.â€�
Roboticists are working on the same kinds of problems: They teach simulated robots to grasp objects, then use what the system learned to drive a research robot. â€œThe results seem convincing, and I can see how this is very useful for games and maybe also for CGI in movies and videos,â€� says OpenAI engineer Matthias Plappert, who recently got a robot hand to teach itself how to grasp like a human. But not for physical robotsâ€”not yet. â€œJust because something works in simulation does not mean that it’s going to work on the robot,â€� says Hodgins. â€œThere are miles to go between just getting this to work on a simulated character, no matter how natural looking, and getting it to be able to work on a physical piece of hardware.â€�
Who knowsâ€”what begins today as an avatar dribbling and sometimes falling on its face, may eventually lead to a humanoid robot that dribbles and falls on its face on an actual court. Never hurts to dream.
More Great WIRED Stories