How AI Finds Key Sports Moments in Long Videos

Peter Bubenik ยท Sony AI ยท ยท Source

๐ŸŽฏ Learning Outcomes

After studying this material, you should be able to:

  1. Define Precise Event Spotting (PES) and explain why it is challenging
  2. Identify the two core problems: long-range dependency and class imbalance
  3. Explain how the proposed modules (ASTRM and long-range temporal module) solve these problems
  4. Understand what contrastive loss is and how SoftIC loss addresses class imbalance
  5. Evaluate why end-to-end training outperforms feature-extraction-only approaches

๐Ÿ“š Step-by-Step Study Material


STEP 1: What is Precise Event Spotting (PES)?

The Basic Concept

Imagine watching a 3-hour football match recording. You want a computer to automatically find:

  • What happened (a goal, a foul, a corner kick)
  • Exactly when it happened (not approximately โ€” the precise frame/moment)

This is Precise Event Spotting.

Key Vocabulary

TermMeaning
Untrimmed videoA long, unedited video (e.g., full match recording)
EventA specific action of interest (goal, card, etc.)
SpottingLocating the exact timestamp of an event
PreciseNot just "somewhere in this 10-second clip" โ€” the exact moment

Why is it Hard?

Full Match Video (90+ minutes)
|-----------------------------------------------|
         โ†‘              โ†‘         โ†‘
      Goal at        Foul at   Card at
      23:14          67:02     78:45
      
โ†’ Must find these exact moments among thousands of frames

โœ… Check your understanding: PES is harder than simply classifying a short clip because you must also locate the event in time within a very long video.


STEP 2: Problem #1 โ€” Long-Range Dependency

What is a Dependency in Video?

Events in sports don't happen in isolation. Context matters:

Frame 1000: Player receives ball
Frame 1050: Player dribbles
Frame 1100: Player shoots
Frame 1110: โ† GOAL (the event to detect)

To correctly identify frame 1110 as a goal, the model needs to "remember" what happened in frames 1000โ€“1109.

What is a Long-Range Dependency?

A long-range dependency means the model needs information from far-away frames to understand the current frame.

Short-range:  [Frame 1108] โ†’ [Frame 1109] โ†’ [Frame 1110] โœ“ easy
Long-range:   [Frame 500]  โ†’ ... โ†’ [Frame 1110]          โœ— hard

Why Do Existing Methods Fail Here?

Most existing methods use convolutional neural networks (CNNs), which look at small local windows of frames. They are like reading a book one sentence at a time without remembering earlier chapters.

CNN Window:  |--5 frames--|  slides along video
             โ†‘ Only sees nearby context
             โœ— Misses long-range context

The Proposed Solution: Long-Range Temporal Module

This module captures global context โ€” it can connect information from distant parts of the video.

Think of it like this:

Without long-range module:
[Frame 1] [Frame 2] ... [Frame 1000] [Frame 1001] โ† isolated

With long-range module:
[Frame 1] โ†โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ†’ [Frame 1001]
          All frames can "talk" to each other

๐Ÿ”‘ Key Insight: Technologies like Transformers (used in ChatGPT) are commonly used for this because they use attention mechanisms โ€” they let every frame attend to every other frame.


STEP 3: Problem #2 โ€” Class Imbalance

What is Class Imbalance?

In a sports video, not all events happen equally often:

Event Distribution in a Football Match:
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Background (no event):  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 95%
Ball out of play:        โ–ˆโ–ˆ                   3%
Goal:                    โ–Œ                    0.5%
Red card:                โ–                    0.1%
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Why is This a Problem?

If you train a model on this data, it learns:

"If I just predict 'background' every time, I'm right 95% of the time!"

This is called a lazy/biased model โ€” it ignores rare but important events.

Naive Model Prediction:
Frame 1:    Background โœ“ (correct, but trivial)
Frame 2:    Background โœ“ (correct, but trivial)
...
Frame 1110: Background โœ— (WRONG โ€” this was a goal!)

The Proposed Solution: Soft Instance Contrastive (SoftIC) Loss

To understand SoftIC loss, we need to first understand what a loss function does.

What is a Loss Function?

A loss function measures how wrong the model is and guides it to improve.

Model Output โ†’ Loss Function โ†’ "You were this wrong" โ†’ Model Updates
What is Contrastive Learning?

Contrastive learning teaches the model:

  • Pull together similar things (same class)
  • Push apart different things (different classes)
Feature Space (simplified to 2D):

Before training:          After contrastive training:
  G  B  G                    G G
  B  R  B          โ†’       B   B
  G  B  G                    R
  
G=Goal, B=Background, R=Red Card
(scattered)               (clustered by class)
What Makes SoftIC "Soft"?

Standard contrastive loss treats all negatives (wrong classes) equally. SoftIC is smarter:

Standard Contrastive:
"Goal" vs "Background" โ†’ push apart (same force)
"Goal" vs "Red Card"   โ†’ push apart (same force)

SoftIC (Soft):
"Goal" vs "Background" โ†’ push apart STRONGLY (very different)
"Goal" vs "Red Card"   โ†’ push apart GENTLY (both are rare events, somewhat similar)

๐Ÿ”‘ Key Insight: "Soft" means the degree of separation is proportional to how different the classes actually are. This is more nuanced and effective.

How Does SoftIC Help with Class Imbalance?
Without SoftIC:
Rare class (Goal) features โ†’ scattered, confused with background

With SoftIC:
Rare class (Goal) features โ†’ compact cluster, clearly separated
                             even with few training examples

STEP 4: The Feature Extractor โ€” ASTRM

What is a Feature Extractor?

Before classifying events, the model must convert raw video frames into meaningful numerical representations called features.

Raw Video Frames โ†’ Feature Extractor โ†’ Feature Vector โ†’ Classifier โ†’ Event Label
[pixels]                               [numbers]

What is Spatio-Temporal Information?

  • Spatial = information about where things are in a frame (position, shape)
  • Temporal = information about when/how things change across frames (motion)
Spatial:   [Frame 1110] โ†’ Where is the ball? Where is the goal?
Temporal:  [Frame 1108โ†’1109โ†’1110] โ†’ How fast is the ball moving?

Spatio-Temporal: Both together โ†’ Ball moving fast toward goal = likely a shot!

What is ASTRM?

Adaptive Spatio-Temporal Refinement Module (ASTRM) is a component that enhances the features extracted from video by adding rich spatio-temporal information.

Basic CNN Features:        [spatial info only]
         โ†“
      ASTRM
         โ†“
Enhanced Features:         [spatial + temporal + adaptive refinement]

"Adaptive" means it adjusts its behavior based on the input โ€” it doesn't apply the same transformation to every video the same way.

Slow play scenario:   ASTRM focuses more on spatial details
Fast action scenario: ASTRM focuses more on temporal motion

Why Not Just Use Pre-trained Features?

Existing methods often use features from large networks pre-trained on general tasks (like ImageNet โ€” classifying cats, dogs, etc.).

Pre-trained on: General images
Used for:       Sports event spotting
Problem:        Mismatch! General features โ‰  Sports-specific features

The proposed method trains end-to-end โ€” meaning the feature extractor is trained specifically for PES:

End-to-End Training:
Raw Video โ†’ [Feature Extractor + ASTRM + Temporal Module] โ†’ Event Prediction
            โ†‘_____________________________________________โ†‘
                    All trained together for PES
            
Result: Features optimized specifically for spotting sports events

STEP 5: Putting It All Together โ€” The Complete Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              COMPLETE PES PIPELINE                       โ”‚
โ”‚                                                         โ”‚
โ”‚  Long Sports Video                                      โ”‚
โ”‚       โ”‚                                                 โ”‚
โ”‚       โ–ผ                                                 โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                        โ”‚
โ”‚  โ”‚  Convolutional Spatial-     โ”‚  โ† Extracts basic      โ”‚
โ”‚  โ”‚  Temporal Feature Extractor โ”‚    spatial+temporal     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    features            โ”‚
โ”‚                โ”‚                                        โ”‚
โ”‚                โ–ผ                                        โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                        โ”‚
โ”‚  โ”‚         ASTRM               โ”‚  โ† Refines features    โ”‚
โ”‚  โ”‚  (Adaptive Spatio-Temporal  โ”‚    adaptively          โ”‚
โ”‚  โ”‚   Refinement Module)        โ”‚                        โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                        โ”‚
โ”‚                โ”‚                                        โ”‚
โ”‚                โ–ผ                                        โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                        โ”‚
โ”‚  โ”‚  Long-Range Temporal Module โ”‚  โ† Captures global     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    context             โ”‚
โ”‚                โ”‚                                        โ”‚
โ”‚                โ–ผ                                        โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                        โ”‚
โ”‚  โ”‚  Classifier + SoftIC Loss   โ”‚  โ† Handles class       โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    imbalance           โ”‚
โ”‚                โ”‚                                        โ”‚
โ”‚                โ–ผ                                        โ”‚
โ”‚  Event: "GOAL" at timestamp 23:14                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

STEP 6: Why Does This Outperform Existing Methods?

Let's compare systematically:

ChallengeExisting MethodsProposed Method
Feature qualityPre-trained general featuresEnd-to-end trained, task-specific
Spatial-temporal infoBasicEnhanced via ASTRM
Long-range contextLimited (local windows)Full (long-range temporal module)
Class imbalanceIgnored or basic handlingSoftIC loss
TrainingPartial (only classifier)Full end-to-end

๐Ÿง  Summary: Core Concepts at a Glance

PES = Find WHAT event + EXACTLY WHEN in long sports videos

Problem 1: Long-Range Dependency
โ†’ Solution: Long-Range Temporal Module (global attention)

Problem 2: Class Imbalance  
โ†’ Solution: SoftIC Loss (soft contrastive learning)

Enhancement: ASTRM
โ†’ Adaptively refines spatio-temporal features

Training: End-to-End
โ†’ Everything optimized together for PES specifically

โœ… Self-Assessment Questions

Test yourself before moving on:

  1. What is the difference between "event detection" and "precise event spotting"?

    Hint: Think about the word "precise" and what it implies about timing

  2. Why would a model trained on imbalanced data tend to ignore rare events?

    Hint: Think about what "being right most of the time" means when data is skewed

  3. What does "end-to-end training" mean and why is it beneficial here?

    Hint: Think about what gets optimized and for what purpose

  4. In your own words, explain what contrastive learning teaches a model to do.

    Hint: Think about "pulling" and "pushing" in feature space

  5. Why is "adaptive" an important property of ASTRM?

    Hint: Think about how different sports scenarios require different focus


๐Ÿ”— Connections to Broader Concepts

If you want to deepen your understanding, explore these related topics:

  • Transformer & Attention Mechanisms โ†’ Foundation of long-range temporal modeling
  • Contrastive Learning โ†’ Self-supervised learning paradigm (SimCLR, MoCo)
  • Class Imbalance Techniques โ†’ Focal Loss, SMOTE, weighted sampling
  • Convolutional Neural Networks (CNNs) โ†’ Basis of the feature extractor
  • Transfer Learning vs. End-to-End Training โ†’ When each approach is better

More to study