A Context-Aware Loss Function for Action Spotting in Soccer Videos

Anthony Cioppa, Adrien Deliège, Silvio Giancola, Bernard Ghanem, Marc Van Droogenbroeck, Rikke Gade, Thomas B. Moeslund · DOI

Abstract

In video understanding, action spotting consists in temporally localizing human-induced events annotated with single timestamps. In this paper, we propose a novel loss function that specifically considers the temporal context naturally present around each action, rather than focusing on the single annotated frame to spot. We benchmark our loss on a large dataset of soccer videos, SoccerNet, and achieve an improvement of 12.8% over the baseline. We show the generalization capability of our loss for generic activity proposals and detection on ActivityNet, by spotting the beginning and the end of each activity. Furthermore, we provide an extended ablation study and display challenging cases for action spotting in soccer videos. Finally, we qualitatively illustrate how our loss induces a precise temporal understanding of actions and show how such semantic knowledge can be used for automatic highlights generation.

Introduction

Action spotting is the task of identifying the exact timestamp of specific events in video streams, such as goals or substitutions in sports. Unlike action recognition or temporal localization, spotting relies on sparse, single-point annotations. This sparsity, combined with temporal discontinuity (where adjacent frames appear identical but have different labels) and inherent ambiguity in event timing, creates significant challenges for standard machine learning models.

Methods

The authors introduce Action Context Slicing, a method that categorizes the temporal vicinity of an event into distinct functional zones. This approach moves beyond binary "action vs. background" classification by recognizing the varying semantic importance of frames surrounding an event:

  • Far Before/After: Background regions with no action influence.
  • Just Before (Possible Action): The buildup phase. Predictions here are not penalized because the outcome (e.g., whether an attack results in a goal) is still visually uncertain.
  • Just After (Action Occurred): The post-event phase containing clear visual evidence like celebrations. The model is heavily penalized for missing the action here.
  • Transition Zones: Buffers ensuring a continuous loss function.
Action Context Slicing and Time-Shift Encoding (TSE) used to re-encode ground-truth labels based on temporal distance from the action.

This logic is implemented through Time-Shift Encoding (TSE) and a dual-module architecture. A Segmentation Module first predicts per-frame action probabilities, which are then processed by a Spotting Module to produce discrete timestamps. To optimize the model, an Iterative One-to-One Matching algorithm pairs predictions with ground-truth events, avoiding penalties related to the temporal order of detection.

The proposed two-part architecture consisting of a Segmentation Module for per-frame features and a Spotting Module for final predictions.

Results and Evaluation

The framework was evaluated on SoccerNet, a dataset of 500 soccer games, and ActivityNet, a general-purpose activity dataset. On SoccerNet, the model achieved an Average-mAP of 62.5%, a substantial 12.8% improvement over the state-of-the-art baseline. The loss function also proved effective for general activity detection on ActivityNet, improving performance by 0.38% without modifying the underlying network. Precision for goal spotting reached 80% within a 10-second tolerance window.

Discussion and Insights

A key finding is that asymmetric temporal context is vital. By not forcing the model to commit to a prediction during the uncertain buildup phase (Just Before), training noise is reduced. Interestingly, the model's "false positives" often correspond to unannotated but interesting moments (e.g., near-misses), suggesting the model learns deep semantic features useful for automatic highlight generation. However, the model still struggles with the "Vicinity Challenge," where rapid successive actions have overlapping temporal contexts.

Limitations and Future Work

A primary limitation is the "Half-Time" Problem, where events like substitutions occurring during breaks lack visual context and are difficult to spot. Future research may integrate multi-modal data, such as crowd audio or broadcast graphics, to improve robustness in these visually ambiguous scenarios.

Summary updated

BibTeX
@inproceedings{cioppa2019context,
  author = {Anthony Cioppa and Adrien Deliège and Silvio Giancola and Bernard Ghanem and Marc Van Droogenbroeck and Rikke Gade and Thomas B. Moeslund},
  title = {{A Context-Aware Loss Function for Action Spotting in Soccer Videos}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr42600.2020.01314},
}
Figure