ABOUT THE SPEAKER
Rajiv Maheswaran - Researcher
Using advanced data analysis tools, Rajiv Maheswaran and Second Spectrum help make basketball teams smarter.

Why you should listen

Sports fans can get obsessed with stats about player performance and game-day physics. But basketball, a fluid and fast-moving game, has been tough to understand through numbers. Rajiv Maheswaran is working to change that, by offering pro basketball teams insight into game data to make better decisions. Maheswaran is the CEO and co-founder of Second Spectrum, a startup transforming sports through technology. He is also a Research Assistant Professor at the University of Southern California's Computer Science Department and a Project Leader at the Information Sciences Institute at the USC Viterbi School of Engineering, where he co-directs the Computational Behavior Group.

His research spans various aspects of multi-agent systems and distributed artificial intelligence using decision-theoretic and game-theoretic frameworks and solutions. His current interests focus on data analytics, visualization and real-time interaction to understand behavior in spatiotemporal domains. Like, say, the spatiotemporal domain around a basketball hoop.

More profile about the speaker
Rajiv Maheswaran | Speaker | TED.com
TED2015

Rajiv Maheswaran: The math behind basketball's wildest moves

Filmed:
2,683,104 views

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.
- Researcher
Using advanced data analysis tools, Rajiv Maheswaran and Second Spectrum help make basketball teams smarter. Full bio

Double-click the English transcript below to play the video.

00:12
My colleagues and I are fascinated
by the science of moving dots.
0
954
3583
00:16
So what are these dots?
1
4927
1150
00:18
Well, it's all of us.
2
6101
1287
00:19
And we're moving in our homes,
in our offices, as we shop and travel
3
7412
5085
00:24
throughout our cities
and around the world.
4
12521
2066
00:26
And wouldn't it be great
if we could understand all this movement?
5
14958
3669
00:30
If we could find patterns and meaning
and insight in it.
6
18918
2890
00:34
And luckily for us, we live in a time
7
22259
1785
00:36
where we're incredibly good
at capturing information about ourselves.
8
24068
4497
00:40
So whether it's through
sensors or videos, or apps,
9
28807
3663
00:44
we can track our movement
with incredibly fine detail.
10
32494
2809
00:48
So it turns out one of the places
where we have the best data about movement
11
36092
5032
00:53
is sports.
12
41148
1208
00:54
So whether it's basketball or baseball,
or football or the other football,
13
42682
5333
01:00
we're instrumenting our stadiums
and our players to track their movements
14
48039
4402
01:04
every fraction of a second.
15
52465
1313
01:05
So what we're doing
is turning our athletes into --
16
53802
4382
01:10
you probably guessed it --
17
58208
1959
01:12
moving dots.
18
60191
1396
01:13
So we've got mountains of moving dots
and like most raw data,
19
61946
4934
01:18
it's hard to deal with
and not that interesting.
20
66904
2502
01:21
But there are things that, for example,
basketball coaches want to know.
21
69430
3769
01:25
And the problem is they can't know them
because they'd have to watch every second
22
73223
3810
01:29
of every game, remember it and process it.
23
77057
2589
01:31
And a person can't do that,
24
79804
1930
01:33
but a machine can.
25
81758
1310
01:35
The problem is a machine can't see
the game with the eye of a coach.
26
83661
3410
01:39
At least they couldn't until now.
27
87363
2261
01:42
So what have we taught the machine to see?
28
90228
2103
01:45
So, we started simply.
29
93569
1787
01:47
We taught it things like passes,
shots and rebounds.
30
95380
3799
01:51
Things that most casual fans would know.
31
99203
2541
01:53
And then we moved on to things
slightly more complicated.
32
101768
2832
01:56
Events like post-ups,
and pick-and-rolls, and isolations.
33
104624
4588
02:01
And if you don't know them, that's okay.
Most casual players probably do.
34
109377
3543
02:05
Now, we've gotten to a point where today,
the machine understands complex events
35
113560
5340
02:10
like down screens and wide pins.
36
118924
3073
02:14
Basically things only professionals know.
37
122021
2726
02:16
So we have taught a machine to see
with the eyes of a coach.
38
124771
4388
02:22
So how have we been able to do this?
39
130009
1857
02:24
If I asked a coach to describe
something like a pick-and-roll,
40
132511
3118
02:27
they would give me a description,
41
135653
1640
02:29
and if I encoded that as an algorithm,
it would be terrible.
42
137317
2856
02:33
The pick-and-roll happens to be this dance
in basketball between four players,
43
141026
4278
02:37
two on offense and two on defense.
44
145328
1912
02:39
And here's kind of how it goes.
45
147486
1618
02:41
So there's the guy on offense
without the ball
46
149128
2533
02:43
the ball and he goes next to the guy
guarding the guy with the ball,
47
151685
3209
02:46
and he kind of stays there
48
154918
1257
02:48
and they both move and stuff happens,
and ta-da, it's a pick-and-roll.
49
156199
3317
02:51
(Laughter)
50
159540
2215
02:53
So that is also an example
of a terrible algorithm.
51
161779
2508
02:56
So, if the player who's the interferer --
he's called the screener --
52
164913
4204
03:01
goes close by, but he doesn't stop,
53
169278
2872
03:04
it's probably not a pick-and-roll.
54
172174
1765
03:06
Or if he does stop,
but he doesn't stop close enough,
55
174560
3945
03:10
it's probably not a pick-and-roll.
56
178529
1761
03:12
Or, if he does go close by
and he does stop
57
180642
3237
03:15
but they do it under the basket,
it's probably not a pick-and-roll.
58
183903
3324
03:19
Or I could be wrong,
they could all be pick-and-rolls.
59
187462
2524
03:22
It really depends on the exact timing,
the distances, the locations,
60
190010
4568
03:26
and that's what makes it hard.
61
194602
1495
03:28
So, luckily, with machine learning,
we can go beyond our own ability
62
196579
4944
03:33
to describe the things we know.
63
201547
1743
03:35
So how does this work?
Well, it's by example.
64
203314
2280
03:37
So we go to the machine and say,
"Good morning, machine.
65
205759
2830
03:41
Here are some pick-and-rolls,
and here are some things that are not.
66
209077
3359
03:44
Please find a way to tell the difference."
67
212720
2252
03:47
And the key to all of this is to find
features that enable it to separate.
68
215076
3707
03:50
So if I was going
to teach it the difference
69
218807
2109
03:52
between an apple and orange,
70
220940
1381
03:54
I might say, "Why don't you
use color or shape?"
71
222345
2375
03:56
And the problem that we're solving is,
what are those things?
72
224744
2943
03:59
What are the key features
73
227711
1247
04:00
that let a computer navigate
the world of moving dots?
74
228982
3499
04:04
So figuring out all these relationships
with relative and absolute location,
75
232505
4823
04:09
distance, timing, velocities --
76
237352
1909
04:11
that's really the key to the science
of moving dots, or as we like to call it,
77
239440
4928
04:16
spatiotemporal pattern recognition,
in academic vernacular.
78
244392
3344
04:19
Because the first thing is,
you have to make it sound hard --
79
247925
2898
04:22
because it is.
80
250847
1278
04:24
The key thing is, for NBA coaches,
it's not that they want to know
81
252410
3141
04:27
whether a pick-and-roll happened or not.
82
255575
1922
04:29
It's that they want to know
how it happened.
83
257521
2076
04:31
And why is it so important to them?
So here's a little insight.
84
259621
2986
04:34
It turns out in modern basketball,
85
262631
1771
04:36
this pick-and-roll is perhaps
the most important play.
86
264426
2539
04:39
And knowing how to run it,
and knowing how to defend it,
87
267065
2620
04:41
is basically a key to winning
and losing most games.
88
269709
2670
04:44
So it turns out that this dance
has a great many variations
89
272403
3801
04:48
and identifying the variations
is really the thing that matters,
90
276228
3648
04:51
and that's why we need this
to be really, really good.
91
279900
2529
04:55
So, here's an example.
92
283228
1176
04:56
There are two offensive
and two defensive players,
93
284428
2379
04:58
getting ready to do
the pick-and-roll dance.
94
286831
2152
05:01
So the guy with ball
can either take, or he can reject.
95
289007
2683
05:04
His teammate can either roll or pop.
96
292086
3001
05:07
The guy guarding the ball
can either go over or under.
97
295111
2986
05:10
His teammate can either show
or play up to touch, or play soft
98
298121
4565
05:14
and together they can
either switch or blitz
99
302710
2618
05:17
and I didn't know
most of these things when I started
100
305352
2659
05:20
and it would be lovely if everybody moved
according to those arrows.
101
308035
3920
05:23
It would make our lives a lot easier,
but it turns out movement is very messy.
102
311979
3905
05:28
People wiggle a lot and getting
these variations identified
103
316047
5484
05:33
with very high accuracy,
104
321555
1303
05:34
both in precision and recall, is tough
105
322882
1868
05:36
because that's what it takes to get
a professional coach to believe in you.
106
324774
3618
05:40
And despite all the difficulties
with the right spatiotemporal features
107
328416
3380
05:43
we have been able to do that.
108
331820
1474
05:45
Coaches trust our ability of our machine
to identify these variations.
109
333318
3927
05:49
We're at the point where
almost every single contender
110
337478
3533
05:53
for an NBA championship this year
111
341035
1623
05:54
is using our software, which is built
on a machine that understands
112
342682
4408
05:59
the moving dots of basketball.
113
347114
1634
06:01
So not only that, we have given advice
that has changed strategies
114
349872
5153
06:07
that have helped teams win
very important games,
115
355049
3352
06:10
and it's very exciting because you have
coaches who've been in the league
116
358425
3732
06:14
for 30 years that are willing to take
advice from a machine.
117
362181
3067
06:17
And it's very exciting,
it's much more than the pick-and-roll.
118
365874
2906
06:20
Our computer started out
with simple things
119
368804
2076
06:22
and learned more and more complex things
120
370904
2064
06:24
and now it knows so many things.
121
372992
1561
06:26
Frankly, I don't understand
much of what it does,
122
374577
2835
06:29
and while it's not that special
to be smarter than me,
123
377436
3715
06:33
we were wondering,
can a machine know more than a coach?
124
381175
3644
06:36
Can it know more than person could know?
125
384843
2055
06:38
And it turns out the answer is yes.
126
386922
1745
06:40
The coaches want players
to take good shots.
127
388691
2557
06:43
So if I'm standing near the basket
128
391272
1651
06:44
and there's nobody near me,
it's a good shot.
129
392947
2166
06:47
If I'm standing far away surrounded
by defenders, that's generally a bad shot.
130
395137
3940
06:51
But we never knew how good "good" was,
or how bad "bad" was quantitatively.
131
399101
4876
06:56
Until now.
132
404209
1150
06:57
So what we can do, again,
using spatiotemporal features,
133
405771
3058
07:00
we looked at every shot.
134
408853
1374
07:02
We can see: Where is the shot?
What's the angle to the basket?
135
410251
3005
07:05
Where are the defenders standing?
What are their distances?
136
413280
2762
07:08
What are their angles?
137
416066
1331
07:09
For multiple defenders, we can look
at how the player's moving
138
417421
2977
07:12
and predict the shot type.
139
420422
1433
07:13
We can look at all their velocities
and we can build a model that predicts
140
421879
4074
07:17
what is the likelihood that this shot
would go in under these circumstances?
141
425977
4052
07:22
So why is this important?
142
430188
1500
07:24
We can take something that was shooting,
143
432102
2803
07:26
which was one thing before,
and turn it into two things:
144
434929
2680
07:29
the quality of the shot
and the quality of the shooter.
145
437633
2651
07:33
So here's a bubble chart,
because what's TED without a bubble chart?
146
441680
3262
07:36
(Laughter)
147
444966
1014
07:38
Those are NBA players.
148
446004
1311
07:39
The size is the size of the player
and the color is the position.
149
447339
3120
07:42
On the x-axis,
we have the shot probability.
150
450483
2132
07:44
People on the left take difficult shots,
151
452639
1953
07:46
on the right, they take easy shots.
152
454616
2229
07:49
On the [y-axis] is their shooting ability.
153
457194
2057
07:51
People who are good are at the top,
bad at the bottom.
154
459275
2562
07:53
So for example, if there was a player
155
461861
1760
07:55
who generally made
47 percent of their shots,
156
463621
2097
07:57
that's all you knew before.
157
465718
1389
07:59
But today, I can tell you that player
takes shots that an average NBA player
158
467345
4850
08:04
would make 49 percent of the time,
159
472219
1961
08:06
and they are two percent worse.
160
474204
1684
08:08
And the reason that's important
is that there are lots of 47s out there.
161
476266
4515
08:13
And so it's really important to know
162
481714
2549
08:16
if the 47 that you're considering
giving 100 million dollars to
163
484287
3956
08:20
is a good shooter who takes bad shots
164
488267
3055
08:23
or a bad shooter who takes good shots.
165
491346
2397
08:27
Machine understanding doesn't just change
how we look at players,
166
495130
3333
08:30
it changes how we look at the game.
167
498487
1858
08:32
So there was this very exciting game
a couple of years ago, in the NBA finals.
168
500369
3755
08:36
Miami was down by three,
there was 20 seconds left.
169
504148
3207
08:39
They were about to lose the championship.
170
507379
2025
08:41
A gentleman named LeBron James
came up and he took a three to tie.
171
509428
3341
08:44
He missed.
172
512793
1198
08:46
His teammate Chris Bosh got a rebound,
173
514015
1837
08:47
passed it to another teammate
named Ray Allen.
174
515876
2159
08:50
He sank a three. It went into overtime.
175
518059
1919
08:52
They won the game.
They won the championship.
176
520002
2096
08:54
It was one of the most exciting
games in basketball.
177
522122
2444
08:57
And our ability to know
the shot probability for every player
178
525438
3429
09:00
at every second,
179
528891
1188
09:02
and the likelihood of them getting
a rebound at every second
180
530103
2956
09:05
can illuminate this moment in a way
that we never could before.
181
533083
3443
09:09
Now unfortunately,
I can't show you that video.
182
537618
2668
09:12
But for you, we recreated that moment
183
540310
4493
09:16
at our weekly basketball game
about 3 weeks ago.
184
544827
2336
09:19
(Laughter)
185
547279
2167
09:21
And we recreated the tracking
that led to the insights.
186
549573
3410
09:25
So, here is us.
This is Chinatown in Los Angeles,
187
553199
4255
09:29
a park we play at every week,
188
557478
1564
09:31
and that's us recreating
the Ray Allen moment
189
559066
2231
09:33
and all the tracking
that's associated with it.
190
561321
2229
09:36
So, here's the shot.
191
564772
1517
09:38
I'm going to show you that moment
192
566313
2516
09:40
and all the insights of that moment.
193
568853
2587
09:43
The only difference is, instead
of the professional players, it's us,
194
571464
3730
09:47
and instead of a professional
announcer, it's me.
195
575218
2618
09:49
So, bear with me.
196
577860
1477
09:53
Miami.
197
581153
1150
09:54
Down three.
198
582671
1150
09:56
Twenty seconds left.
199
584107
1150
09:59
Jeff brings up the ball.
200
587385
1198
10:02
Josh catches, puts up a three!
201
590656
1535
10:04
[Calculating shot probability]
202
592631
1849
10:07
[Shot quality]
203
595278
1150
10:09
[Rebound probability]
204
597048
1785
10:12
Won't go!
205
600373
1173
10:13
[Rebound probability]
206
601570
1446
10:15
Rebound, Noel.
207
603777
1256
10:17
Back to Daria.
208
605057
1150
10:18
[Shot quality]
209
606509
3365
10:22
Her three-pointer -- bang!
210
610676
1620
10:24
Tie game with five seconds left.
211
612320
2197
10:26
The crowd goes wild.
212
614880
1618
10:28
(Laughter)
213
616522
1659
10:30
That's roughly how it happened.
214
618205
1547
10:31
(Applause)
215
619776
1151
10:32
Roughly.
216
620951
1175
10:34
(Applause)
217
622150
1531
10:36
That moment had about a nine percent
chance of happening in the NBA
218
624121
5484
10:41
and we know that
and a great many other things.
219
629629
2261
10:43
I'm not going to tell you how many times
it took us to make that happen.
220
631914
3491
10:47
(Laughter)
221
635429
1747
10:49
Okay, I will! It was four.
222
637200
1872
10:51
(Laughter)
223
639096
1001
10:52
Way to go, Daria.
224
640121
1165
10:53
But the important thing about that video
225
641647
4263
10:57
and the insights we have for every second
of every NBA game -- it's not that.
226
645934
4568
11:02
It's the fact you don't have to be
a professional team to track movement.
227
650639
3929
11:07
You do not have to be a professional
player to get insights about movement.
228
655083
3657
11:10
In fact, it doesn't even have to be about
sports because we're moving everywhere.
229
658764
3858
11:15
We're moving in our homes,
230
663654
2369
11:21
in our offices,
231
669428
1205
11:24
as we shop and we travel
232
672238
2690
11:29
throughout our cities
233
677318
1253
11:32
and around our world.
234
680065
1618
11:35
What will we know? What will we learn?
235
683270
2295
11:37
Perhaps, instead of identifying
pick-and-rolls,
236
685589
2305
11:39
a machine can identify
the moment and let me know
237
687918
3010
11:42
when my daughter takes her first steps.
238
690952
2059
11:45
Which could literally be happening
any second now.
239
693035
2536
11:48
Perhaps we can learn to better use
our buildings, better plan our cities.
240
696140
3697
11:52
I believe that with the development
of the science of moving dots,
241
700362
4173
11:56
we will move better, we will move smarter,
we will move forward.
242
704559
3643
12:00
Thank you very much.
243
708607
1189
12:01
(Applause)
244
709820
5045

▲Back to top

ABOUT THE SPEAKER
Rajiv Maheswaran - Researcher
Using advanced data analysis tools, Rajiv Maheswaran and Second Spectrum help make basketball teams smarter.

Why you should listen

Sports fans can get obsessed with stats about player performance and game-day physics. But basketball, a fluid and fast-moving game, has been tough to understand through numbers. Rajiv Maheswaran is working to change that, by offering pro basketball teams insight into game data to make better decisions. Maheswaran is the CEO and co-founder of Second Spectrum, a startup transforming sports through technology. He is also a Research Assistant Professor at the University of Southern California's Computer Science Department and a Project Leader at the Information Sciences Institute at the USC Viterbi School of Engineering, where he co-directs the Computational Behavior Group.

His research spans various aspects of multi-agent systems and distributed artificial intelligence using decision-theoretic and game-theoretic frameworks and solutions. His current interests focus on data analytics, visualization and real-time interaction to understand behavior in spatiotemporal domains. Like, say, the spatiotemporal domain around a basketball hoop.

More profile about the speaker
Rajiv Maheswaran | Speaker | TED.com

Data provided by TED.

This site was created in May 2015 and the last update was on January 12, 2020. It will no longer be updated.

We are currently creating a new site called "eng.lish.video" and would be grateful if you could access it.

If you have any questions or suggestions, please feel free to write comments in your language on the contact form.

Privacy Policy

Developer's Blog

Buy Me A Coffee