Inspiration

The idea for this project emerged from the growing importance of sports analytics and how technology can offer new insights into baseball. Statcast has revolutionized how we measure game performance, but most of the available data is from recent games. I wanted to explore the possibility of extracting similar metrics, like pitch speed and exit velocity, from archival baseball videos. This would allow us to analyze historic games and gain fresh perspectives on the past.

What it does

MetricBase extracts fundamental Statcast metrics such as pitch speed, exit velocity, and ball trajectory from old baseball game videos. It uses computer vision and machine learning to identify key events, track motion, and analyze the data to calculate metrics that would typically be recorded in modern games. The results are displayed on a user-friendly dashboard, allowing users to easily explore and download the extracted data.

How we built it

We collected archival baseball videos and used OpenCV to extract frames for analysis. Object detection models like YOLOv8 were employed to identify players, the baseball, and key objects. Motion tracking algorithms (DeepSORT, Kalman Filter) were used to follow the ball’s trajectory. We implemented machine learning models in TensorFlow and PyTorch to estimate pitch speed and exit velocity. The results were integrated into a React-based dashboard hosted on Google Cloud for easy access.

Challenges we ran into

One of the main challenges was working with low-resolution and noisy archival videos, which made object detection and motion tracking difficult. Manual annotations for training models were time-consuming, and optimizing real-time processing of long videos added complexity to the system.

Accomplishments that we're proud of

We successfully built a system that can extract key Statcast metrics from archival videos, bringing new life to historic baseball games. Despite challenges with video quality, we were able to accurately track and calculate metrics like pitch speed and exit velocity. The user-friendly dashboard is another proud accomplishment, allowing anyone to upload videos and see the results instantly.

What we learned

This project helped us deepen our understanding of computer vision, machine learning, and data engineering, particularly in the context of sports analytics. We learned how to work with video data, implement motion tracking, and create models for estimating performance metrics. We also gained valuable experience in cloud infrastructure, using tools like Google Cloud to scale the application.

What's next for MetricBase

Moving forward, we plan to improve the accuracy of our models, especially in handling low-quality footage. We also aim to incorporate more advanced metrics like spin rate and pitch type detection. Enhancements in real-time processing and model training automation will allow us to analyze longer and more complex game footage with greater precision.

Share this project:

Updates