Skip to content

Repository files navigation

NFL Defensive Analysis

This project was created using data from the NFL Big Data Bowl 2025. The dataset has since been removed from Kaggle, and it is a violation of the license to re-upload it to GitHub.

Project Goal

This project uses tracking data from the 2025 NFL Big Data Bowl to analyze defensive coverages from pre-snap behavior. Its main goal is to use player tracking data in real time to predict a coverage diagram similar to the one shown below:

Coverage Diagram

The predictions are generated using machine learning models based on individual player features.


Model Results

The model outputs both overall and player-by-player predictions based on individual frames before snap. It predicts defensive coverage from four options: Cover-1, Cover-2, Cover-3, and Quarters; and offensive formation from seven options: Shotgun, Singleback, Empty, I-Form, Pistol, Jumbo, and Wildcat. Predictions for both tasks were based only on defensive players.

Team-Level Accuracy

Task Train Accuracy Val Accuracy
Defensive Coverage 98.7 97.5
Offensive Formation 98.6 96.5

Success with offensive formation is particularly significant; the model can accurately predict offensive formation just from defensive positioning.

Player-Level Accuracy

The model also predicts player-level binary tasks including identifying deep safeties, blitzers, and man-on-man defenders.

Task Train Accuracy Val Accuracy
Deep Safeties 91.3 90.8
Blitzer 85.2 83.6
Man-on-Man 83.1 80.5

Deep safeties are shown with yellow zones, man defenders with short black arrows, and blitzers with long red arrows. Predicted formations are displayed in green if correct.

The model outputs a Matplotlib video of predictions (can be obtained by running main.py). Deep safeties are shown with yellow zones around them; Man defenders are shown with short black arrows; Blitzers are shown with long red arrows. Predicted offensive and defensive formations are shown in the right panel in green if correct. Video demos are shown below.

ScreenRecording2025-09-23at9 26 31AM-ezgif com-video-to-gif-converter ScreenRecording2025-09-23at10 02 55AM-ezgif com-video-to-gif-converter


Model Architecture

The coverage model takes input features for each player (x, y, speed, acceleration, orientation, movement direction, and position encoded as one-hot) and generates a 12-dimensional feature vector for each player. These vectors are flattened for the entire team and passed through a sequence of Dense layers, then classified using a softmax classifier. This architecture was used for both offensive formation and defensive coverage models.

Coverage Model Architecture

The player prediction model uses the same 12-dimensional feature vectors per player, but instead of flattening, each player's features are individually passed through Dense layers followed by a sigmoid classifier. Separate models were trained for Blitzers, Deep Safeties, and Man-on-Man assignments.

Player Prediction Architecture

Any player with a prediction probability above 75% was classified as a blitzer or man defender. Deep safeties are determined hierarchically based on the predicted coverage.


Installation and Usage

The project is hosted on this GitHub repository, with the exception of the NFL Big Data Bowl Dataset due to license restrictions.

If you have access to the dataset, update the following paths in data_compiler.py:

self.data_path = "parquet_data/week_5_data.parquet"
self.tracking_dir_path = "nfl-big-data-bowl-2025/old_tracking"
self.players_data_path = "./nfl-big-data-bowl-2025/players.csv"
self.plays_data_path = "./nfl-big-data-bowl-2025/plays.csv"
self.player_play_data_path = "./nfl-big-data-bowl-2025/player_play.csv"
  • Running any script starting with train trains a specified model.
  • Running main.py displays the model's results in a Matplotlib window.
  • All trained TensorFlow models are stored in the /models directory.
  • All files are fully documented; only main.py and training scripts can be executed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages