Skip to content

Time Series Trajectory Prediction using Transformer

Notifications You must be signed in to change notification settings

treeebooor/bigBaller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

🏀 bigBaller 🏀

A transformer based system for multi-agent time series prediction in a game of basketball.

Visualization of Basketball Data

Animation taken from this repo.

Contents

  1. Overview
  2. Source Code
  3. Results
  4. Future Works

Overview

Basketball is a complex game that can be modeled as a multi-agent system involving intricate interactions between the players, the ball, and the hoops. If we can understand these various interactions, we can gain insights into player behavior, team dynamics, and strategies. This further understanding can enable better play making, enhanced coaching, or stronger player development.

This project aims to take a step in this direction by predicting the future trajectory of the ball given a sequence of past player and ball position coordinates. Two different directions where considered: micro and macro game understanding.

The goal of the micro case is to understand the intircate movements of the ball in a short period of time(0.5s). This hopefully caputures the physics of the ball in 3D space as the ball is dribbled, shot, or passed.

In the macro scenario, the objective is to learn the overall game movements in a 2D space over a longer period of time(2s). This macro level understanding of the game can be used to analyze game strategies or player movements throughout an entire possession or sequence of plays.

Results

Due to resource limiations, model was trained on 50 games from the 2016 NBA season. Dataset can be found here

Blue is the trajectory of the ball given as input to the model.

Green is ground truth future trajectory.

Red is the predicted trajectory .

The small x's represent players on the court, colorcoded by team.

Macro: Using 2 seconds to predict 2 seconds.

Pass Dribble down the court
pass prediction dribble prediction
Jump Ball Incorrect Pass Prediction

Micro: Using 1 second to predict 0.5 seconds

Shot bounce on rim Bounce pass or dribble
Shot prediction Wrong pass prediction

Future Works

  • All player trajectory predictions
  • Longer predictions sequences
  • Analyze game plays
  • Extend to other applications, pedestrian mapping