< 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:13
    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:26
    And luckily for us, we live in a time
    where we're incredibly good
  • 0:27 - 0:29
    at capturing information about ourselves.
  • 0:29 - 0:32
    So whether it's through
    sensors or videos, or apps,
  • 0:33 - 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
  • 0:41 - 0:42
    about movement 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:53
    every fraction of a second.
  • 0:54 - 1:00
    So what we're doing is turning our
    athletes into -- you probably guessed it
  • 1:00 - 1:01
    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:23
    And a person can't do that...
    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:28 - 1:30
    At least they couldn't until now.
  • 1:30 - 1:33
    So what have we taught the machine to see?
  • 1:33 - 1:38
    So, we started simply.
    We taught it things like passes,
  • 1:38 - 1:39
    shots and rebounds.
  • 1:39 - 1:43
    Things that most casual fans would know.
    And then we moved on to things
  • 1:43 - 1:44
    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:05
    like down screens and wide pins.
    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:15
    So how have we been able to do this?
    If I asked a coach to describe something
  • 2:15 - 2:17
    like a pick-and-roll, they would
    give me a description and
  • 2:17 - 2:20
    if I encoded that as an algorithm,
    it would be terrible.
  • 2:21 - 2:25
    The pick-and-roll happens to be the stance
    in basketball between four players,
  • 2:25 - 2:27
    two on offense and two on defense.
  • 2:28 - 2:29
    And here's kind of how it goes.
  • 2:29 - 2:33
    So there's the guy on offense without
    the ball and he goes next to the guy
  • 2:34 - 2:36
    guarding the guy with the ball,
    and he kind of stays there
  • 2:36 - 2:39
    and they both move and stuff happens,
    and ta-da, it's a pick-and-roll.
  • 2:40 - 2:41
    (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
    you know, goes close by,
    but he doesn't stop.
  • 2:52 - 2:54
    It's probably not a pick-and-roll.
  • 2:55 - 2:58
    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:05
    Or, if he does go close by
    and he does stop but they do it
  • 3:05 - 3:07
    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:14
    It really depends on the exact timing,
    the distances, the locations
  • 3:14 - 3:16
    and that 's what makes it hard.
  • 3:17 - 3:21
    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 somethings that are not."
  • 3:32 - 3:35
    "Please find a way to tell a difference."
  • 3:35 - 3:39
    And the key to all of this is to find
    features that enable it to separate.
  • 3:39 - 3:42
    So if I was trying to teach it
    the difference between an apple and orange,
  • 3:42 - 3:44
    I might say, "Why don't you use color,
    or shape?"
  • 3:44 - 3:48
    And the problem that we're solving is,
    what are those things?
  • 3:48 - 3:52
    What are the key features that let a
    computer navigate the world of moving dots?
  • 3:53 - 3:57
    So figuring out all these relationships
    with relative, 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:10
    Because the first thing is,
    you have to make it sound hard
  • 4:10 - 4:12
    and... because it is.
  • 4:13 - 4:15
    The key thing is for NBA coaches,
    it's not that they want to know
  • 4:15 - 4:17
    whether a pick-and-roll happened or not.
  • 4:17 - 4:19
    It's that they want to know how it happened.
  • 4:20 - 4:22
    And why is it so important to them?
    So here's a little insight.
  • 4:22 - 4:25
    It turns out in modern basketball, this
    pick-and-roll is perhaps
  • 4:25 - 4:27
    the most important play.
  • 4:27 - 4:29
    And knowing how to run it,
    and knowing how to defend it,
  • 4:29 - 4:32
    is basically a key to winning
    and losing most games.
  • 4:32 - 4:36
    So it turns out that the dance has
    a great many variations
  • 4:36 - 4:40
    and identifying the variations are really
    the things that matter,
  • 4:40 - 4:42
    and that's why we need it to be
    really, really good.
  • 4:42 - 4:45
    So, here's an example.
    There's two offensive players
  • 4:45 - 4:48
    getting ready to do the pick-and-roll dance.
  • 4:48 - 4:52
    So the guy with ball can either take,
    or he can reject.
  • 4:52 - 4:58
    His teammate can either roll or pop. The
    guy guarding the ball can go over or under.
  • 4:58 - 5:02
    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:09
    and I didn't know most of the things
    when I started and it would be
  • 5:09 - 5:12
    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 with very, very
  • 5:22 - 5:26
    high accuracy, both in precision and recall
    is tough because that's what it takes
  • 5:26 - 5:28
    to get a professional coach
    to believe in you.
  • 5:28 - 5:31
    And despite all the difficulties with
    the right spatiotemoporal features
  • 5:32 - 5:33
    we have been able to do that.
  • 5:33 - 5:37
    Coaches trust are ability of our machine
    to identify these variations.
  • 5:37 - 5:43
    We're at the point where almost every
    single contender for an NBA championship
  • 5:43 - 5:47
    this year 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:59 - 6:01
    and it's very exciting because you have
    coaches who've been in the league for
  • 6:02 - 6:05
    30 years, that are willing to take advice
    from a machine.
  • 6:06 - 6:08
    And it's very exciting.
    It's much more than the pick-and-roll.
  • 6:09 - 6:11
    Our computer have started with simple
    things and learnt more and more
  • 6:11 - 6:14
    complex things and now it knows
    so many things.
  • 6:14 - 6:19
    Frankly, I don't understand much of what
    it does and while it's not special
  • 6:20 - 6:22
    to be smarter than me,
    we were wondering,
  • 6:23 - 6:27
    can a machine know more than a coach?
    Could it know more than person could know?
  • 6:27 - 6:29
    Turns out the answer is yes.
  • 6:29 - 6:32
    Coaches want players to take good shots.
    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 and 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:53
    We looked at every shot. We can see where
    is the shot? What's the angle to the basket?
  • 6:54 - 6:56
    Where are the defenders standing?
    What are their distances?
  • 6:56 - 6:57
    What are there angles?
  • 6:57 - 7:02
    For multiple defenders, we can look at how
    players move 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:15
    So why is this important?
    We can take something that was shooting,
  • 7:15 - 7:18
    that was one thing before, and turn it
    into two things.
  • 7:18 - 7:21
    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:29
    Those are NBA players.
    The size is the size of the player
  • 7:29 - 7:30
    and the color is the position.
  • 7:30 - 7:34
    On the x-axis, we've the shot probability.
    People on the left take difficult shots,
  • 7:35 - 7:36
    on the right, they take easy shots.
  • 7:37 - 7:41
    On the right is their shooting ability.
    People who are good at the top,
  • 7:41 - 7:42
    bad at the bottom.
  • 7:42 - 7:46
    So for example, if there was a player who
    generally made 47% of their shots
  • 7:46 - 7:47
    that's all you knew before.
  • 7:48 - 7:52
    But today, I can tell you that player
    takes shots that an average NBA player
  • 7:52 - 7:56
    would make 49% of the time
    and they were 2% worse.
  • 7:56 - 8:01
    And the reason that's important,
    is that there are lots of 47s out there.
  • 8:02 - 8:07
    And so it's really important to know
    if the 47 that you're considering
  • 8:07 - 8:11
    giving 100 million dollars to,
    is a good shooter who takes bad shots
  • 8:11 - 8:14
    or bad shooter who takes good shots.
  • 8:15 - 8:19
    Machine understanding doesn't
    change how we look at players,
  • 8:19 - 8:22
    it changes how we look at the game.
    So there was this very exciting game
  • 8:22 - 8:24
    a couple of years ago, in the NBA finals.
  • 8:24 - 8:28
    Miami was down by three,
    there was 20 seconds left.
  • 8:28 - 8:30
    They were about to lose the championship.
    A gentleman named Lebron James
  • 8:30 - 8:33
    came up and he took a three to tie.
  • 8:33 - 8:36
    He missed.
    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:46 - 8:49
    And our ability to know the shot
    probability for every player
  • 8:49 - 8:52
    at every second, and the likelihood
    of them getting a rebound at every second
  • 8:52 - 8:57
    can illuminate this moment in a way
    that we never could before.
  • 8:57 - 9:03
    Now unfortunately, I can't show you that
    video, but for you we recreated
  • 9:03 - 9:07
    that moment 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:14 - 9:17
    So, here is us.
    This is Chinatown in Los Angeles,
  • 9:18 - 9:21
    a park we play every week at and that's us
    recreating the Ray Allen moment
  • 9:21 - 9:24
    and all the tracking that's associated.
  • 9:25 - 9:29
    So, here's the shot.
    I'm going to show you that moment
  • 9:29 - 9:32
    and all the insights of that moment.
  • 9:32 - 9:34
    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:40
    So, bare with me.
  • 9:41 - 9:46
    Miami. Down three. 20 seconds left.
  • 9:48 - 9:52
    Jeff brings up the ball... Josh catches,
    puts up a three!
  • 10:01 - 10:06
    Won't go! Rebound Noel(??), back to Daria.
  • 10:11 - 10:15
    Her 3-pointer -- bang!
    Tied game with five seconds left.
  • 10:15 - 10:17
    The crowd goes wild.
  • 10:17 - 10:18
    (Laughter)
  • 10:19 - 10:20
    That's roughly how it happened.
  • 10:20 - 10:21
    (Applause)
  • 10:22 - 10:22
    Roughly.
  • 10:24 - 10:29
    I'm not going to -- that moment had about
    a 9% chance of happening in the NBA
  • 10:30 - 10:32
    and we know that and a great many other things.
  • 10:32 - 10:36
    I'm not going to tell you how many times
    it took us to make that happen.
  • 10:36 - 10:38
    (Laughter)
  • 10:38 - 10:40
    Okay, I will!
    It was four, it was four.
  • 10:40 - 10:42
    Way to go Doug(??).
  • 10:42 - 10:48
    But the important thing about that video
    and the insights we have for every second
  • 10:49 - 10:51
    of every NBA game, It's not that.
  • 10:52 - 10:54
    It's the fact you don't have to be a
    professional team to track movement.
  • 10:55 - 10:58
    You do not have to be a professional player
    to get insights about movement.
  • 10:58 - 11:02
    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:10 - 11:11
    In our offices.
  • 11:12 - 11:22
    As we shop and we travel, throughout
    our cities and around our world.
  • 11:23 - 11:27
    What will we know? What will we learn?
    Perhaps, instead of identifying
  • 11:27 - 11:31
    pick-and-rolls, a machine can identify
    the moment and let me know when
  • 11:31 - 11:33
    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:51
    (Applause)
Title:
The math behind basketball's wildest moves
Speaker:
Rajiv Maheswaran
Description:

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

English subtitles

Revisions Compare revisions