PWHL On-Ice Player Tracker

Stat tracking today is a manual process in the PWHL. Unlike the NHL, players do not wear sensors tracking their movement, and there is no sensor in the puck tracking speed. So each hit, goal, penalty, etc. is recorded by someone watching the game. Due to the speed of action in hockey, this is naturally an error prone process. Along with that, it leaves some stats untracked, namely: hit recipient, penalty recipient, player speed, puck speed, and on and on.

This post is an introduction to a player tracking model I have been building to help in recording stats and highlight players on the ice. In this post I will showcase two features:

  1. Tracking a player receiving a hit (very similar to penalty recipient)
  2. Tracking a player who scores a goal

Tracking the Recipient

PWHL stats do record the player who completes a hit or commits a penalty. What is not recorded, however, is the recipient of the hit/penalty.

But why would we want to know that?

For hit recipients, we can learn who is being targeted by other teams or who is willing to get scrappy to make a play.

For penalty recipients, the implications go a little deeper. One of the major calculated stats for a player is Wins Above Replacement (WAR), which effectively calculates a player's production vs that of a replacement. Part of the calculation, and the only one not tracked in official stats, is penalties received. The reason penalties received is part of the calculation can be thought of as "this player was going to create a goal-scoring chance so the other team had to foul them to stop them". In other words, the player would have added an assist/goal/other offensive stat to their numbers if not fouled.

The clip below showcases the ability to track players along the ice who receive a hit:

Clip description: the ring in this video tracks Katy Knoll, the recipient of the hit. The known player in this play is Izzy Daniel, who is credited with the hit. The model has used a combination of player tracking, jersey-number reading, and rink geometry to figure out who are the players on the ice, and who creates and receives contact.

Tracking the Goal Scorer

A much simpler, but opposite application of the player tracker. Since goal scorers are tracked in official stats, the model needs to identify and keep track of the goal scorer in the video. This can still come with difficulties as players cross paths and cause pile-ups in front of the net, causing a lot of noise for the model.

The clip below shows Rebecca Leslie charging down the ice and scoring.

Clip description: Rebecca Leslie, tying it with a minute left in the first. Watch the ring: it picks her up in open ice on the rush, where the 37 on her back is perfectly legible, and it's still on her a second later when she's one of six bodies in the blue paint and her number has vanished.

What's actually happening in those clips

Every one of these is a broadcast clip, downloaded from the same YouTube stream anybody can watch, run through six stages:

  1. Line up the game clock with the video clock, so "second period, 5:52" becomes a specific second of the stream.
  2. Work out where the camera is pointed, so a position on screen becomes a position on the ice.
  3. Find the people.
  4. Follow each person from frame to frame.
  5. Work out which real player each one is.
  6. Draw it.

Discoveries So Far

Going through the replays with this model, several errors and inconsistencies have been found in the official stats. In the subset of games I have tracked so far I have found:

  1. Hits attributed to players on the wrong team. Eleven of them, across eight games, each one confirmed by watching the play. One game has three. A common flavour: both teams dress the same sweater number, and the number gets read off the wrong jersey.
  2. Hits attributed to players who were not on the ice. In all eleven of the cases above, the credited player is also absent from the official shift log at the moment she supposedly threw the hit. The shift log is a cheap automatic cross-check, but also error prone itself due to on-the-fly shift changes.
  3. Event timestamps that lag the play. Stamps land after the moment they describe, penalties especially. This was measured the expensive way: an early version of the pipeline cut a window three seconds either side of the stamp and kept missing the contact entirely, because it had already happened. The window now starts eight seconds early, and sixteen more for a delayed penalty.

So beyond the expansion of available statistics, this tool has shown to be a useful second-look at events that have been recorded by hand.

So What's Next

This is a demo of what the end product looks like when it all goes right. Follow up posts will be about each step of creating and training this model. The posts will include where things went right, where things went wrong, how I created training data (so many blurry images tagged by hand), and what tools were off the shelf vs created by me.