Return to Video

The math behind basketball's wildest moves

  • 0:01 - 0:05
    My colleagues and I are fascinated
    by the science of moving dots.
  • 0:05 - 0:06
    So what are these dots?
  • 0:06 - 0:07
    Well, it's all of us.
  • 0:07 - 0:12
    And we're moving in our homes,
    in our offices, as we shop and travel
  • 0:13 - 0:15
    throughout our cities
    and around the world.
  • 0:15 - 0:19
    And wouldn't it be great
    if we could understand all this movement?
  • 0:19 - 0:22
    If we could find patterns and meaning
    and insight in it.
  • 0:22 - 0:24
    And luckily for us, we live in a time
  • 0:24 - 0:29
    where we're incredibly good
    at capturing information about ourselves.
  • 0:29 - 0:32
    So whether it's through
    sensors or videos, or apps,
  • 0:32 - 0:35
    we can track our movement
    with incredibly fine detail.
  • 0:36 - 0:41
    So it turns out one of the places
    where we have the best data about movement
  • 0:41 - 0:42
    is sports.
  • 0:43 - 0:48
    So whether it's basketball or baseball,
    or football or the other football,
  • 0:48 - 0:52
    we're instrumenting our stadiums
    and our players to track their movements
  • 0:52 - 0:54
    every fraction of a second.
  • 0:54 - 0:58
    So what we're doing
    is turning our athletes into --
  • 0:58 - 1:00
    you probably guessed it --
  • 1:00 - 1:02
    moving dots.
  • 1:02 - 1:07
    So we've got mountains of moving dots
    and like most raw data,
  • 1:07 - 1:09
    it's hard to deal with
    and not that interesting.
  • 1:09 - 1:13
    But there are things that, for example,
    basketball coaches want to know.
  • 1:13 - 1:17
    And the problem is they can't know them
    because they'd have to watch every second
  • 1:17 - 1:20
    of every game, remember it and process it.
  • 1:20 - 1:22
    And a person can't do that,
  • 1:22 - 1:23
    but a machine can.
  • 1:24 - 1:27
    The problem is a machine can't see
    the game with the eye of a coach.
  • 1:27 - 1:30
    At least they couldn't until now.
  • 1:30 - 1:32
    So what have we taught the machine to see?
  • 1:34 - 1:35
    So, we started simply.
  • 1:35 - 1:39
    We taught it things like passes,
    shots and rebounds.
  • 1:39 - 1:42
    Things that most casual fans would know.
  • 1:42 - 1:45
    And then we moved on to things
    slightly more complicated.
  • 1:45 - 1:49
    Events like post-ups,
    and pick-and-rolls, and isolations.
  • 1:49 - 1:53
    And if you don't know them, that's okay.
    Most casual players probably do.
  • 1:54 - 1:59
    Now, we've gotten to a point where today,
    the machine understands complex events
  • 1:59 - 2:02
    like down screens and wide pins.
  • 2:02 - 2:05
    Basically things only professionals know.
  • 2:05 - 2:09
    So we have taught a machine to see
    with the eyes of a coach.
  • 2:10 - 2:12
    So how have we been able to do this?
  • 2:13 - 2:16
    If I asked a coach to describe
    something like a pick-and-roll,
  • 2:16 - 2:17
    they would give me a description,
  • 2:17 - 2:20
    and if I encoded that as an algorithm,
    it would be terrible.
  • 2:21 - 2:25
    The pick-and-roll happens to be this dance
    in basketball between four players,
  • 2:25 - 2:27
    two on offense and two on defense.
  • 2:27 - 2:29
    And here's kind of how it goes.
  • 2:29 - 2:32
    So there's the guy on offense
    without the ball
  • 2:32 - 2:35
    the ball and he goes next to the guy
    guarding the guy with the ball,
  • 2:35 - 2:36
    and he kind of stays there
  • 2:36 - 2:40
    and they both move and stuff happens,
    and ta-da, it's a pick-and-roll.
  • 2:40 - 2:42
    (Laughter)
  • 2:42 - 2:44
    So that is also an example
    of a terrible algorithm.
  • 2:45 - 2:49
    So, if the player who's the interferer --
    he's called the screener --
  • 2:49 - 2:52
    goes close by, but he doesn't stop,
  • 2:52 - 2:54
    it's probably not a pick-and-roll.
  • 2:55 - 2:59
    Or if he does stop,
    but he doesn't stop close enough,
  • 2:59 - 3:00
    it's probably not a pick-and-roll.
  • 3:01 - 3:04
    Or, if he does go close by
    and he does stop
  • 3:04 - 3:07
    but they do it under the basket,
    it's probably not a pick-and-roll.
  • 3:07 - 3:10
    Or I could be wrong,
    they could all be pick-and-rolls.
  • 3:10 - 3:15
    It really depends on the exact timing,
    the distances, the locations,
  • 3:15 - 3:16
    and that's what makes it hard.
  • 3:17 - 3:22
    So, luckily, with machine learning,
    we can go beyond our own ability
  • 3:22 - 3:23
    to describe the things we know.
  • 3:23 - 3:26
    So how does this work?
    Well, it's by example.
  • 3:26 - 3:29
    So we go to the machine and say,
    "Good morning, machine.
  • 3:29 - 3:32
    Here are some pick-and-rolls,
    and here are some things that are not.
  • 3:33 - 3:35
    Please find a way to tell the difference."
  • 3:35 - 3:39
    And the key to all of this is to find
    features that enable it to separate.
  • 3:39 - 3:41
    So if I was going
    to teach it the difference
  • 3:41 - 3:42
    between an apple and orange,
  • 3:42 - 3:45
    I might say, "Why don't you
    use color or shape?"
  • 3:45 - 3:48
    And the problem that we're solving is,
    what are those things?
  • 3:48 - 3:49
    What are the key features
  • 3:49 - 3:52
    that let a computer navigate
    the world of moving dots?
  • 3:53 - 3:57
    So figuring out all these relationships
    with relative and absolute location,
  • 3:57 - 3:59
    distance, timing, velocities --
  • 3:59 - 4:04
    that's really the key to the science
    of moving dots, or as we like to call it,
  • 4:04 - 4:08
    spatiotemporal pattern recognition,
    in academic vernacular.
  • 4:08 - 4:11
    Because the first thing is,
    you have to make it sound hard --
  • 4:11 - 4:12
    because it is.
  • 4:12 - 4:16
    The key thing is, for NBA coaches,
    it's not that they want to know
  • 4:16 - 4:17
    whether a pick-and-roll happened or not.
  • 4:18 - 4:20
    It's that they want to know
    how it happened.
  • 4:20 - 4:23
    And why is it so important to them?
    So here's a little insight.
  • 4:23 - 4:24
    It turns out in modern basketball,
  • 4:24 - 4:27
    this pick-and-roll is perhaps
    the most important play.
  • 4:27 - 4:30
    And knowing how to run it,
    and knowing how to defend it,
  • 4:30 - 4:32
    is basically a key to winning
    and losing most games.
  • 4:32 - 4:36
    So it turns out that this dance
    has a great many variations
  • 4:36 - 4:40
    and identifying the variations
    is really the thing that matters,
  • 4:40 - 4:42
    and that's why we need this
    to be really, really good.
  • 4:43 - 4:44
    So, here's an example.
  • 4:44 - 4:47
    There are two offensive
    and two defensive players,
  • 4:47 - 4:49
    getting ready to do
    the pick-and-roll dance.
  • 4:49 - 4:52
    So the guy with ball
    can either take, or he can reject.
  • 4:52 - 4:55
    His teammate can either roll or pop.
  • 4:55 - 4:58
    The guy guarding the ball
    can either go over or under.
  • 4:58 - 5:03
    His teammate can either show
    or play up to touch, or play soft
  • 5:03 - 5:05
    and together they can
    either switch or blitz
  • 5:05 - 5:08
    and I didn't know
    most of these things when I started
  • 5:08 - 5:12
    and it would be lovely if everybody moved
    according to those arrows.
  • 5:12 - 5:16
    It would make our lives a lot easier,
    but it turns out movement is very messy.
  • 5:16 - 5:22
    People wiggle a lot and getting
    these variations identified
  • 5:22 - 5:23
    with very high accuracy,
  • 5:23 - 5:25
    both in precision and recall, is tough
  • 5:25 - 5:28
    because that's what it takes to get
    a professional coach to believe in you.
  • 5:28 - 5:32
    And despite all the difficulties
    with the right spatiotemporal features
  • 5:32 - 5:33
    we have been able to do that.
  • 5:33 - 5:37
    Coaches trust our ability of our machine
    to identify these variations.
  • 5:37 - 5:41
    We're at the point where
    almost every single contender
  • 5:41 - 5:43
    for an NBA championship this year
  • 5:43 - 5:47
    is using our software, which is built
    on a machine that understands
  • 5:47 - 5:49
    the moving dots of basketball.
  • 5:50 - 5:55
    So not only that, we have given advice
    that has changed strategies
  • 5:55 - 5:58
    that have helped teams win
    very important games,
  • 5:58 - 6:02
    and it's very exciting because you have
    coaches who've been in the league
  • 6:02 - 6:05
    for 30 years that are willing to take
    advice from a machine.
  • 6:06 - 6:09
    And it's very exciting,
    it's much more than the pick-and-roll.
  • 6:09 - 6:11
    Our computer started out
    with simple things
  • 6:11 - 6:13
    and learned more and more complex things
  • 6:13 - 6:15
    and now it knows so many things.
  • 6:15 - 6:17
    Frankly, I don't understand
    much of what it does,
  • 6:17 - 6:21
    and while it's not that special
    to be smarter than me,
  • 6:21 - 6:25
    we were wondering,
    can a machine know more than a coach?
  • 6:25 - 6:27
    Can it know more than person could know?
  • 6:27 - 6:29
    And it turns out the answer is yes.
  • 6:29 - 6:31
    The coaches want players
    to take good shots.
  • 6:31 - 6:33
    So if I'm standing near the basket
  • 6:33 - 6:35
    and there's nobody near me,
    it's a good shot.
  • 6:35 - 6:39
    If I'm standing far away surrounded
    by defenders, that's generally a bad shot.
  • 6:39 - 6:44
    But we never knew how good "good" was,
    or how bad "bad" was quantitatively.
  • 6:44 - 6:45
    Until now.
  • 6:46 - 6:49
    So what we can do, again,
    using spatiotemporal features,
  • 6:49 - 6:50
    we looked at every shot.
  • 6:50 - 6:53
    We can see: Where is the shot?
    What's the angle to the basket?
  • 6:53 - 6:56
    Where are the defenders standing?
    What are their distances?
  • 6:56 - 6:57
    What are their angles?
  • 6:57 - 7:00
    For multiple defenders, we can look
    at how the player's moving
  • 7:00 - 7:02
    and predict the shot type.
  • 7:02 - 7:06
    We can look at all their velocities
    and we can build a model that predicts
  • 7:06 - 7:10
    what is the likelihood that this shot
    would go in under these circumstances?
  • 7:10 - 7:12
    So why is this important?
  • 7:12 - 7:15
    We can take something that was shooting,
  • 7:15 - 7:18
    which was one thing before,
    and turn it into two things:
  • 7:18 - 7:20
    the quality of the shot
    and the quality of the shooter.
  • 7:22 - 7:25
    So here's a bubble chart,
    because what's TED without a bubble chart?
  • 7:25 - 7:26
    (Laughter)
  • 7:26 - 7:27
    Those are NBA players.
  • 7:27 - 7:30
    The size is the size of the player
    and the color is the position.
  • 7:30 - 7:33
    On the x-axis,
    we have the shot probability.
  • 7:33 - 7:35
    People on the left take difficult shots,
  • 7:35 - 7:37
    on the right, they take easy shots.
  • 7:37 - 7:39
    On the [y-axis] is their shooting ability.
  • 7:39 - 7:42
    People who are good are at the top,
    bad at the bottom.
  • 7:42 - 7:44
    So for example, if there was a player
  • 7:44 - 7:46
    who generally made
    47 percent of their shots,
  • 7:46 - 7:47
    that's all you knew before.
  • 7:47 - 7:52
    But today, I can tell you that player
    takes shots that an average NBA player
  • 7:52 - 7:54
    would make 49 percent of the time,
  • 7:54 - 7:56
    and they are two percent worse.
  • 7:56 - 8:01
    And the reason that's important
    is that there are lots of 47s out there.
  • 8:02 - 8:04
    And so it's really important to know
  • 8:04 - 8:08
    if the 47 that you're considering
    giving 100 million dollars to
  • 8:08 - 8:11
    is a good shooter who takes bad shots
  • 8:11 - 8:14
    or a bad shooter who takes good shots.
  • 8:15 - 8:18
    Machine understanding doesn't just change
    how we look at players,
  • 8:18 - 8:20
    it changes how we look at the game.
  • 8:20 - 8:24
    So there was this very exciting game
    a couple of years ago, in the NBA finals.
  • 8:24 - 8:27
    Miami was down by three,
    there was 20 seconds left.
  • 8:27 - 8:29
    They were about to lose the championship.
  • 8:29 - 8:33
    A gentleman named LeBron James
    came up and he took a three to tie.
  • 8:33 - 8:34
    He missed.
  • 8:34 - 8:36
    His teammate Chris Bosh got a rebound,
  • 8:36 - 8:38
    passed it to another teammate
    named Ray Allen.
  • 8:38 - 8:40
    He sank a three. It went into overtime.
  • 8:40 - 8:42
    They won the game.
    They won the championship.
  • 8:42 - 8:45
    It was one of the most exciting
    games in basketball.
  • 8:45 - 8:49
    And our ability to know
    the shot probability for every player
  • 8:49 - 8:50
    at every second,
  • 8:50 - 8:53
    and the likelihood of them getting
    a rebound at every second
  • 8:53 - 8:57
    can illuminate this moment in a way
    that we never could before.
  • 8:58 - 9:00
    Now unfortunately,
    I can't show you that video.
  • 9:00 - 9:05
    But for you, we recreated that moment
  • 9:05 - 9:07
    at our weekly basketball game
    about 3 weeks ago.
  • 9:07 - 9:09
    (Laughter)
  • 9:10 - 9:13
    And we recreated the tracking
    that led to the insights.
  • 9:13 - 9:17
    So, here is us.
    This is Chinatown in Los Angeles,
  • 9:17 - 9:19
    a park we play at every week,
  • 9:19 - 9:21
    and that's us recreating
    the Ray Allen moment
  • 9:21 - 9:24
    and all the tracking
    that's associated with it.
  • 9:25 - 9:26
    So, here's the shot.
  • 9:26 - 9:29
    I'm going to show you that moment
  • 9:29 - 9:31
    and all the insights of that moment.
  • 9:31 - 9:35
    The only difference is, instead
    of the professional players, it's us,
  • 9:35 - 9:38
    and instead of a professional
    announcer, it's me.
  • 9:38 - 9:39
    So, bear with me.
  • 9:41 - 9:42
    Miami.
  • 9:43 - 9:44
    Down three.
  • 9:44 - 9:45
    Twenty seconds left.
  • 9:47 - 9:49
    Jeff brings up the ball.
  • 9:51 - 9:52
    Josh catches, puts up a three!
  • 9:53 - 9:54
    [Calculating shot probability]
  • 9:55 - 9:56
    [Shot quality]
  • 9:57 - 9:59
    [Rebound probability]
  • 10:00 - 10:02
    Won't go!
  • 10:02 - 10:03
    [Rebound probability]
  • 10:04 - 10:05
    Rebound, Noel.
  • 10:05 - 10:06
    Back to Daria.
  • 10:07 - 10:10
    [Shot quality]
  • 10:11 - 10:12
    Her three-pointer -- bang!
  • 10:12 - 10:15
    Tie game with five seconds left.
  • 10:15 - 10:16
    The crowd goes wild.
  • 10:17 - 10:18
    (Laughter)
  • 10:18 - 10:20
    That's roughly how it happened.
  • 10:20 - 10:21
    (Applause)
  • 10:21 - 10:22
    Roughly.
  • 10:22 - 10:24
    (Applause)
  • 10:24 - 10:30
    That moment had about a nine percent
    chance of happening in the NBA
  • 10:30 - 10:32
    and we know that
    and a great many other things.
  • 10:32 - 10:35
    I'm not going to tell you how many times
    it took us to make that happen.
  • 10:35 - 10:37
    (Laughter)
  • 10:37 - 10:39
    Okay, I will! It was four.
  • 10:39 - 10:40
    (Laughter)
  • 10:40 - 10:41
    Way to go, Daria.
  • 10:42 - 10:46
    But the important thing about that video
  • 10:46 - 10:51
    and the insights we have for every second
    of every NBA game -- it's not that.
  • 10:51 - 10:55
    It's the fact you don't have to be
    a professional team to track movement.
  • 10:55 - 10:59
    You do not have to be a professional
    player to get insights about movement.
  • 10:59 - 11:03
    In fact, it doesn't even have to be about
    sports because we're moving everywhere.
  • 11:04 - 11:06
    We're moving in our homes,
  • 11:09 - 11:11
    in our offices,
  • 11:12 - 11:15
    as we shop and we travel
  • 11:17 - 11:19
    throughout our cities
  • 11:20 - 11:22
    and around our world.
  • 11:23 - 11:26
    What will we know? What will we learn?
  • 11:26 - 11:28
    Perhaps, instead of identifying
    pick-and-rolls,
  • 11:28 - 11:31
    a machine can identify
    the moment and let me know
  • 11:31 - 11:33
    when my daughter takes her first steps.
  • 11:33 - 11:36
    Which could literally be happening
    any second now.
  • 11:36 - 11:40
    Perhaps we can learn to better use
    our buildings, better plan our cities.
  • 11:40 - 11:45
    I believe that with the development
    of the science of moving dots,
  • 11:45 - 11:48
    we will move better, we will move smarter,
    we will move forward.
  • 11:49 - 11:50
    Thank you very much.
  • 11:50 - 11:55
    (Applause)
Title:
The math behind basketball's wildest moves
Speaker:
Rajiv Maheswaran
Description:

Basketball is a fast-moving game of improvisation, contact and, ahem, spatio-temporal pattern recognition. Rajiv Maheswaran and his colleagues are analyzing the movements behind the key plays of the game, to help coaches and players combine intuition with new data. Bonus: What they're learning could help us understand how humans move everywhere.

more » « less
Video Language:
English
Team:
closed TED
Project:
TEDTalks
Duration:
12:08

English subtitles

Revisions Compare revisions