Real-Time NFL Player Position Classification
A deep learning framework for identifying player positions from pre-snap formations using contextual object detection
John Michael Slezak, Atif Khan, Chenhao Lu, Ruida Zeng
Department of Computer Science, Brown University
Overview | Features | Installation | Project Structure | Results | Citation
Playmakers is a computer vision framework for classifying NFL player positions from pre-snap formations using YOLOv8. The unique challenge is that all players appear visually similarโthe model must learn from spatial context and positioning rather than individual features.
- โ Context-Aware Detection โ Leverages player positioning and formation patterns
- โ Real-Time Performance โ Optimized for live game footage analysis
- โ Custom Dataset โ 503 annotated images from NFL championship games
- โ 8 Position Classes โ WR, CB, Safety, LB, RB, QB, TE, Fullback
|
From data preprocessing to real-time inference, all components are production-ready. Processed NFL footage from 2024 Super Bowl + AFC/NFC Championships with 500+ annotated images. |
YOLOv8 architecture enables blazing fast predictions suitable for live analysis. Detailed metrics including confusion matrices, F1 curves, and precision-recall analysis. |
- Python 3.8+
- CUDA-capable GPU (recommended for training)
# Clone the repository
git clone https://github.com/yourusername/the-playmakers.git
cd the-playmakers
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtThe dataset can be downloaded from Roboflow or extracted from the zip files in WR/datasets/:
# Option 1: From Roboflow
from roboflow import Roboflow
rf = Roboflow(api_key="YOUR_API_KEY")
project = rf.workspace("cs-1430").project("wr-finder")
version = project.version(3)
dataset = version.download("yolov8")
# Option 2: Extract from included zip files
# Unzip WR/datasets/NewWRData.zipthe-playmakers/
โ
โโโ ๐ README.md # Project documentation
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ .gitignore # Git ignore rules
โโโ ๐ Final Report.pdf # Academic paper (PDF)
โโโ ๐ Final Poster.pptx # Project poster presentation
โ
โโโ ๐ WR/ # Main project data and code
โ โ
โ โโโ ๐ notebooks/ # Jupyter notebooks
โ โ โโโ main.ipynb # Data loading + color matching + YOLO detection
โ โ โโโ WRYOLOCUSTOM.ipynb # YOLOv8 training via Roboflow (primary)
โ โ โโโ player_detection.ipynb # YOLOv5 training pipeline
โ โ โโโ test_vis.ipynb # Model evaluation & visualization (Colab)
โ โ โโโ newwr_test_vis.ipynb # Model evaluation (local Windows)
โ โ โโโ field_filter.ipynb # Field preprocessing experiments
โ โ
โ โโโ ๐ images/ # Sample images
โ โ โโโ afc_championship_2024.jpg # Input image (2024 AFC Championship)
โ โ โโโ afc_championship_2024_processed.jpg # Processed output after filtering
โ โ โโโ superbowl_lviii_detection_1.png # Detection example (Super Bowl LVIII)
โ โ โโโ superbowl_lviii_detection_2.png # Detection example (Super Bowl LVIII)
โ โ
โ โโโ ๐ datasets/ # Dataset archives
โ โ โโโ NewWRData.zip # Main dataset (train/val/test splits)
โ โ โโโ runs.zip # Training runs (weights, logs, metrics)
โ โ โโโ WR Finder.v1i.yolov8.zip # Roboflow YOLOv8 format
โ โ โโโ WR Finder.v1i.tensorflow.zip # Roboflow TensorFlow format
โ โ
โ โโโ ๐ scripts/ # Python scripts
โ โ โโโ filter_field.py # Standalone field filtering script
โ โ
โ โโโ ๐ docs/ # Additional documentation
โ โโโ color matching poster stuff.docx
โ
โโโ ๐ Final Report/ # LaTeX source for academic paper
โ โโโ main.tex # Main LaTeX document
โ โโโ ProjectFinal_ProjectReportTemplate.bib # Bibliography
โ โโโ ProjectFinal_ProjectReportTemplate.pdf # Compiled PDF
โ โโโ architecture.png # YOLOv8 architecture diagram
โ โโโ confusion_matrix.png # Classification confusion matrix
โ โโโ confidence_curve.png # F1-confidence curve
โ โโโ precison_curve.png # Precision-recall curve
โ โโโ color_matching_1.png # Color matching result example
โ โโโ color_matching_2.png # Color matching result example
โ โโโ matches_1.png # Correct detection example
โ โโโ matches_2.png # Correct detection example
โ โโโ mismatch_1.jpg # Incorrect detection example
โ โโโ mismatch_2.jpg # Incorrect detection example
โ โโโ LabelingExample.png # Roboflow labeling screenshot
โ โโโ [LaTeX style files] # cvpr.cls, cvpr.sty, etc.
โ
โโโ ๐ Templates/ # Course templates (CS 1430)
โโโ README.md # Template instructions
โโโ ProjectFinal_ProposalTemplate.tex
โโโ ProjectFinal_ProgressReportTemplate.tex
โโโ ProjectFinal_ProgressReportTemplate.pdf
โโโ ProjectFinal_PosterTemplate.pptx
โโโ ProjectFinal_PresentationTemplate.pptx
โโโ ProjectFinal_ProjectReportTemplate/
| Notebook | Purpose | Platform |
|---|---|---|
main.ipynb |
Data exploration, color matching algorithm, base YOLO detection | Colab |
WRYOLOCUSTOM.ipynb |
Primary training notebook - YOLOv8 with Roboflow | Colab |
player_detection.ipynb |
Alternative YOLOv5 training (50 epochs) | Colab |
test_vis.ipynb |
Model evaluation with NMS + visualization | Colab |
newwr_test_vis.ipynb |
Same as above, configured for local execution | Local |
field_filter.ipynb |
Field preprocessing to remove logos/end zones | Colab |
# For Google Colab notebooks, upload to Colab and run
# For local notebooks:
cd "WR/notebooks"
jupyter notebook newwr_test_vis.ipynbNote: Notebooks contain hardcoded paths for Google Drive or local directories. Update the
base_diranddata_dirvariables to match your setup.
| Archive | Contents |
|---|---|
NewWRData.zip |
503 labeled images split into train/val/test in YOLO format |
runs.zip |
Training outputs: model weights (best.pt), logs, metrics plots |
WR Finder.v1i.yolov8.zip |
Roboflow export in YOLOv8 format |
WR Finder.v1i.tensorflow.zip |
Roboflow export in TensorFlow format |
| ID | Position | Description |
|---|---|---|
| 0 | Corner Back | Defensive backs covering receivers |
| 1 | Fullback | Offensive blocker/runner |
| 2 | Linebacker | Middle defensive players |
| 3 | Quarterback | Offensive play caller |
| 4 | Running Back | Primary ball carrier |
| 5 | Safety | Deep defensive backs |
| 6 | Tight End | Offensive lineman/receiver hybrid |
| 7 | Wide Receiver | Primary pass catchers |
| Metric | Value |
|---|---|
| mAP@0.5 | 0.759 |
| F1 Score | 0.62 @ conf 0.229 |
| Best Class (WR) | 94.2% precision |
| Corner Back | 88.5% precision |
| Safety | 87.9% precision |
Located in WR/notebooks/main.ipynb:
- Converts images to LAB color space
- Detects players by team jersey colors
- Identifies offense by formation width
- Finds WRs by edge positioning
- Limitation: Sensitive to lighting, logos, end zones
Located in WR/notebooks/WRYOLOCUSTOM.ipynb:
- Single-pass detection for real-time performance
- Grid-based localization with non-max suppression
- Trained on 503 custom-labeled images
- 8 position classes
| Member | Contribution |
|---|---|
| John Michael Slezak | Dataset creation, 503 image labels, YOLO training, report writing |
| Atif Khan | YOLO research & implementation, model training, technical docs |
| Chenhao Lu | Detection research, pre-trained YOLO testing, color matching |
| Ruida Zeng | Field filters, new dataset testing, results analysis, visualization |
- ๐ Expanded Dataset โ More diverse formations and player setups
- ๐ค Alternative Models โ Experiment with DETR or Swin Transformer
- ๐น Player Tracking โ In-play movement analysis across frames
- ๐ฎ Live Integration โ Real-time broadcast overlay support
@project{playmakers2024,
title={The Playmakers: NFL Position Classification Through YOLO},
author={Slezak, John Michael and Khan, Atif and Lu, Chenhao and Zeng, Ruida},
institution={Brown University},
course={CS 1430 Computer Vision},
year={2024}
}TA Mentor: Joel Manasseh | Professor: Srinath Sridhar
Brown University CS 1430 โ Computer Vision Final Project
For questions or suggestions, please reach out via GitHub Issues




