Skip to content
AI.info

Research

HoopMind: A Real-Time Neural Game-Tree System for Opponent-Aware Possession Planning

Overview Research area: Sports analytics combining machine learning (neural shot-outcome prediction) with game-theoretic planning (depth-limited expectimax search), multi-source data fusion, and inter

arXiv
2608.29563
Published
2026-08-30
Authors
Yibo Gong, Cong Guo, Jiacheng Ding

AI summary

Overview

  • Research area: Sports analytics combining machine learning (neural shot-outcome prediction) with game-theoretic planning (depth-limited expectimax search), multi-source data fusion, and interactive browser visualization. Indexed under Machine Learning (cs.LG) with index terms sports analytics, multi-source data fusion, spatiotemporal data mining, interactive visualization, and serious games.
  • Technical level: Advanced. The paper assumes familiarity with Markov games, Markov decision processes, expectimax search, branch-and-bound pruning, embeddings, calibration, and empirical-Bayes shrinkage, though it explains the motivation and system design in plain terms.
  • Scope (1 sentence): The paper builds a fully public-data pipeline that fuses five sources into a 4.23M-shot dataset over 21 seasons, trains an embedding-based shot model, and wraps the results in a real-time pruned search plus two browser tools for opponent-aware possession planning.

What This Paper Is About

School coaches prepare for opponents using only game film, a whiteboard, and intuition, while the analytics tools used by professional teams remain out of reach. The authors ask how far public basketball data alone can close that gap, using professional basketball as a case study chosen for its data availability rather than for the league itself. Their goal is a fast, visual, data-grounded tool that shows where, against whom, and when an opponent is weak, and that lets players feel the answer by playing against a modeled opponent in a browser simulator.

Key Contributions

  1. A per-shot fused dataset from five public sources. Shot locations, two play-by-play feeds, official matchup tracking, and player biometrics are joined into one dataset of 4.23M shots over 21 seasons, with alignment of 99.5% to 100% and 99.9% agreement between sources on matched outcomes. Each shot carries its pre-shot score margin, assist source, clutch flag, blocker identity, and shooter height and weight.

  2. Two documented data pitfalls and their corrections. The paper reports (a) a zero-versus-missing encoding problem in play-by-play files up to 2016-17 that inflates apparent "clutch" shot rates from about 4% to about 7.5%, and (b) post-shot score leakage that creates an artificial margin effect which disappears once the shot's own points are subtracted.

  3. ShotNet, a calibrated embedding MLP for shot value. An embedding multilayer perceptron with about 46k parameters that beats a league zone-rate baseline and a logistic regression baseline on a held-out season, and whose probabilities are well calibrated (10-bin expected calibration error of 0.016).

  4. A pruned real-time possession planner and two interactive tools. A half-court possession is formulated as a two-team zero-sum stochastic game and solved by depth-limited expectimax with branch-and-bound pruning, shipped as a scouting planner and a playable simulator that each run in a single browser page, re-solving the tree every 0.25 seconds.

Main Findings

  • Data fusion holds up across 21 seasons: Across 21 seasons the shot-to-play-by-play match rate never falls below 99.54%, and the two sources agree on 99.9% of matched outcomes. Backcourt heaves, 0.2% of attempts, are dropped.

  • The missing-score pitfall inflates clutch rates: Up to 2016-17, non-scoring play-by-play events carry "0-0" instead of an empty score; filling forward gives margin 0 for most shots and raises the apparent rate of clutch shots (last 5 minutes with |margin| ≤ 5) from about 4% to about 7.5%, with a visible jump at the 2017/2018 file boundary.

  • Post-shot scores create a false margin effect: Used as-is, the recorded score makes teams ahead by 16 or more appear to shoot 55.4% versus 40.3% when behind by 16 or more — a 15.2 percentage point effect. After subtracting the shot's own points, the curve flattens to 46.9% to 48.6% across all margin bins.

  • Pressure and shot type change outcomes (2023-24): In the clutch (last five minutes, |margin| ≤ 5), field goal percentage falls from 47.7% to 43.9%, and three-point percentage falls hardest, from 36.9% to 31.7%.

  • Court position determines how shots are created: Corner threes are assisted on 96% to 97% of makes, against only 46% for mid-range makes. Also, 9.0% of two-point attempts are blocked versus 0.9% of threes.

  • The mid-range emptied out across 21 seasons: The mid-range share of attempts fell from 35.6% to 11.2%, while the three-point share more than doubled, from 18.7% to 39.5%.

  • ShotNet beats both baselines on the held-out 2023-24 season: League zone rate achieves AUC 0.631 / log-loss 0.663; logistic regression on numeric features 0.639 / 0.666; ShotNet 0.646 / 0.648. The authors place this inside the public-feature band of roughly 0.60 to 0.68 reported in prior work, noting shot outcomes stay noisy without defender-distance tracking.

  • ShotNet is well calibrated: Its 10-bin expected calibration error is 0.016, and its mean prediction is 47.4% against a 47.5% base rate. The model exports to 362 KB of JSON and runs in about 10⁴ multiply-adds, one forward pass per frame in the browser. It trains on 3.79M shots from seasons up to 2021-22, validates on 217k shots from 2022-23, and is tested on 218k shots from 2023-24.

  • Opponent profiles align with basketball intuition: In 2023-24 the best rim defense belongs to Oklahoma City, Cleveland, and Minnesota — the teams of rim protectors Holmgren, Mobley, and Gobert — while the weakest belongs to Washington, Portland, and Toronto. Boston's backup centers concede 34.5 points per 100 targeted possessions versus 15.5 for its reserve guards, and Boston defends hardest in the first quarter at 3.1 percentage points below its own average.

  • Pruning cuts computation with little loss in decision quality: Over 300 random states, the shipped setting (k=6, ε=0.02) saves 43.4% of nodes, agrees with exhaustive depth-2 expectimax on the top action in 97.0% of states, and has a mean EP gap of 0.001. Weaker settings are also reported: k=4/ε=0.05 saves 65.8% of nodes with 85.0% agreement and a 0.022 gap; k=5/ε=0.02 saves 55.0% with 91.3% agreement and a 0.008 gap. The exhaustive depth-2 tree evaluates 57.0 leaf shots on average.

  • Turnover risk is modeled explicitly: Drives succeed with probability 1 − λ_dr where λ_dr = 0.06, and passes with 1 − λ_ps where λ_ps = 0.035, taken from turnover rates in the development seasons.

  • Real-time performance in the browser: All training happens offline on a GPU, so the browser re-solves the tree every 0.25 seconds in well under a millisecond. One real-time minute of simulation compresses to about one quarter of play.

  • Coach mode produces concrete, comparable numbers: In the state shown, a contested pull-up three against Boston is worth 0.79 expected points, while driving middle and kicking to the weak-side shooter is worth 1.24 expected points.

Methodology in Plain English

The team gathered five public sources of basketball data and joined them shot by shot on game, player, quarter, minutes left, and seconds left, producing a dataset in which each shot is paired with its pre-shot context. Court positions are reduced to 14 zones (combinations of range and side labels in the league API).

From that dataset they estimate an opponent model at four levels — team by zone, individual defender, quarter of the game, and the individual shot. Rate estimates use empirical-Bayes shrinkage toward the league rate with a prior strength of 100 attempts, so small samples are pulled toward the average. Defender rankings measure points allowed per 100 targeted partial possessions, shrunk, over at least 400 possessions, and are explicitly labeled as output-when-targeted rather than pure ability because coaches hide weak defenders on weak scorers.

For the shot level, ShotNet learns embeddings for the shooter (16-d), defending team (8-d), zone (6-d), and action group (6-d), concatenates them with nine numeric features (x, y, distance, a three-point flag, quarter, seconds left, pre-shot margin, shooter height, shooter weight), and passes them through a 96-64-1 MLP of about 46k parameters. Training uses AdamW, batch size 16384, for four epochs, split strictly by season.

Planning treats a half-court possession as a two-team zero-sum stochastic game. Because solving it exactly in real time is out of reach, the authors make three assumptions: the defense plays an estimated behavioral policy rather than a worst-case adversary; randomness enters only at turnover chance nodes and in the terminal payoff; and search depth is limited. The offensive action set at each node has 8 entries — one shoot, three drives, and four passes. Shoot is always available, so every leaf of the cut-off tree is a genuine terminal. Leaves are priced by ShotNet adjusted for openness and contest, multiplied by the points of the shot and by one minus the block probability read from the team-zone and defender tables.

Search uses branch-and-bound pruning with a fast optimistic bound: an uncontested rim finish for a drive, a near-open catch-and-shoot at the receiver's spot for a pass. Children are sorted by that bound, at most k expand per node, and a branch is cut when its bound falls at or below the best value found so far minus ε. The authors state plainly that the bound is a heuristic rather than provably admissible, so the pruning is approximate, and they measure its cost rather than claiming exactness.

The simulator reuses the standard architecture of commercial sports games — perception delay, steering with bounded acceleration, man or help assignment — but every parameter comes from the data: reaction times from 0.10 to 0.34 seconds based on defender matchup difficulty, speed from position group, block attempts from personal and team-zone block rates, and per-quarter intensity from the team's own curve. The entire pipeline, from raw public files to every number and figure, is reproducible from the public repository by running make; a FastAPI backend serves the same models programmatically.

Why This Matters

The paper is distinctive for showing that a planner which previously required private optical tracking — defensive skill estimation, possession value, and interactive play-sketching — can be approximated from openly published data with an interactive, reproducible system. It also contributes two concrete data-engineering warnings (zero-versus-missing scores and post-shot score leakage) that any researcher fusing play-by-play data can apply directly.

Real-world applications:

  • School and amateur coaching: A fast, visual scouting tool that shows where an opponent is weakest, which defenders to attack, and when, without any paid data subscription.
  • Player development and film study: A playable simulator in which players feel the consequence of shot choices, with a post-game report listing every shot's openness, closest defender, model probability, outcome, and expected points.
  • Interactive analytics in the browser: Both tools are single self-contained HTML files, so they run on a school laptop with no installation, and one real-time minute compresses to about one quarter of play.
  • Cross-sport transfer: The paper's four-step recipe — fuse public event streams, estimate how the opponent defends, learn a calibrated pricing model for terminal actions, then solve the offensive decision tree with pruned search — is proposed for any invasion sport with open event data.

Industry relevance: The work pushes back on two industry conventions. It replaces editor-assigned player ratings in sports games with estimates from data checked on a held-out season, and it shows that a lightweight, well-calibrated model combined with pruned search can deliver real-time decision support in a browser rather than requiring a heavy private-data stack. The framework is also a template for any domain with public event streams and sequential decisions.

Future Directions

  • Porting to additional sports. The authors state they will next port the pipeline to soccer via StatsBomb's open data and to ice hockey via public shot logs, arguing that any invasion sport with open event data qualifies.
  • Correcting defender assignment bias. Because matchup possessions are not assigned at random (coaches hide weak defenders on weak scorers), the authors suggest conditioning on the offensive strength of each defender's assignments to sharpen the rankings.
  • Retaining private tracking features where available. Prior work reports that adding closest-defender distance raises accuracy, but that feature is private; the paper leaves open how much of the remaining gap public-only models can close.
  • Deeper or provably bounded search. Deeper search cost more browser time without changing the action it picked, and the pruning bound U is a heuristic rather than a provably admissible bound; a tighter or provably admissible bound, and more rigorous measurement of pruning's effect on action quality, remain open.

Target Audience

This paper benefits most school and amateur basketball coaches and student players who want data-grounded scouting without professional budgets; sports analytics researchers interested in multi-source public-data fusion, calibration, and interactive deployment; machine learning practitioners interested in embedding models and pruned game-tree search under real-time constraints; and game developers or visualization researchers looking at how sports-game AI architecture can be parameterized from data instead of editorial ratings. It is also useful to anyone doing play-by-play data engineering, because of its two documented pitfalls.

Authors’ abstract

School coaches prepare for opponents with game film and intuition. The analytics tools of professional teams stay out of reach. We ask how far public data can close this gap. Professional basketball is our case study, chosen for its data rather than the league. We fuse five public sources into one per-shot dataset of 4.23M shots over 21 seasons. The sources are shot locations, two play-by-play feeds, official matchup tracking, and player biometrics. Alignment across them is 99.5% to 100%. We also report two data pitfalls that are easy to miss. We then model a half-court possession as a sequential game. Shot values come from ShotNet, an embedding multilayer perceptron (MLP). On a held-out season it beats a zone-rate baseline and a logistic baseline, and its probabilities are well calibrated. A depth-limited expectimax search then solves the offensive decision tree, with branch-and-bound pruning to keep it real time. All training runs offline, so the online system stays light. A scouting planner and a playable simulator both run in a single browser page.

Read the original paper