Localization-Aware Multi-Scale Representation Learning for Repetitive Action Counting

Sujia Wang, Xiangwei Shen, Yansong Tang, Xin Dong, Wenjia Geng, Lei Chen

TL;DR

This paper introduces LMRL (Localization-Aware Multi-Scale Representation Learning), a framework designed to count repetitive actions in videos even when the speed of the action changes or the person takes a break. By combining a multi-scale temporal representation with an explicit foreground localization module, the authors achieve state-of-the-art performance on challenging real-world benchmarks like RepCountA.

What Problem Does This Paper Address?

Repetitive Action Counting (RAC) sounds simple—count how many times someone does a squat or chops a carrot—but real-world video is messy. Most existing methods rely on temporal self-similarity matrices (TSMs) to find periodic patterns. However, these methods often break down due to two main "noise" factors:

  1. Action Inconsistency: As people tire, their movements slow down. A single-scale model tuned for fast movements will fail when the frequency drops (see Figure 1a).
  2. Action Interruptions: Real life involves pauses. If a model treats a rest period as part of the repetitive signal, the count becomes wildly inaccurate (see Figure 1b).
Two challenging cases: (a) speed changes during squats and (b) interruptions during exercise.

Methods

The authors propose the LMRL framework, which moves away from raw frame-to-frame similarity toward a more "discerning" representation. The architecture consists of three main stages:

  • Video Feature Extractor: They use a pre-trained Video Swin Transformer to extract high-level spatial-temporal embeddings from video subsequences.
  • Multi-Scale Period-Aware Representation (MPR): To handle varying speeds, this module computes a "Distribution-Specific Similarity Matrix." It then applies Scale-Specific Attention across 10 different temporal scales (using varying pooling kernel sizes). This allows the model to "see" periodic patterns whether they last 1 second or 3 seconds.
  • Repetition Foreground Localization (RFL): This is a parallel branch using a Temporal Convolutional Network (TCN). Its job is to identify which parts of the video are actually the "foreground" (the action) versus the "background" (rest or noise).
The MPR module uses multiple scales to capture different action frequencies.

The system is trained using a combination of standard counting losses and two clever auxiliary supervisions: a localization loss (binary cross-entropy to distinguish action from rest) and a triplet margin loss (to push foreground and background features further apart in the embedding space).

Datasets

The model was evaluated on two major benchmarks:

  • RepCountA: A large-scale dataset with fine-grained annotations for the start and end of every single repetition.
  • UCFRep: A standard benchmark for repetitive action counting.

Notably, the authors trained their model on RepCountA and tested it on UCFRep without fine-tuning to demonstrate the framework's robust generalization capabilities.

Key Insights and Ideas

  • Scale Matters: The "aha moment" here is that a fixed temporal receptive field is a liability. By hierarchically constructing the similarity representation across multiple scales, the model becomes inherently robust to the natural "slowing down" effect of human fatigue.
  • Localization as a Feature Refiner: Instead of just trying to count better, the authors realized that explicitly teaching the model where the action isn't (localization) makes the features for where the action is much cleaner.
  • Bilateral Optimization: The joint optimization of the MPR and RFL branches ensures that the final embeddings are not just periodic, but semantically meaningful regarding the action itself.

Key Results

LMRL sets a new state-of-the-art on the RepCountA dataset:

  • MAE (Mean Absolute Error): 0.4200 (Lower is better; previous best was 0.4431).
  • OBO (Off-By-One): 0.3816 (Higher is better; previous best was 0.2913).

The ablation studies confirm that the bilateral design is highly efficient. For example, using the RFL branch to localize actions improved the counting accuracy significantly compared to models that treated the entire video as a continuous signal.

Visualization of density maps showing how the model accurately tracks action density compared to ground truth (GT).

Limitations and Future Work

The authors note a specific failure case: when the video sampling rate is very high, the model can sometimes misidentify foreground frames as inactive. They attribute this to an "insufficiency of context information" at high temporal resolutions.

Future work could involve applying this framework to more complex, multi-step repetitive tasks, such as those found in industrial assembly lines or smart kitchen monitoring (e.g., tracking the specific rhythm of whisking or stirring).

Summary updated

BibTeX
@inproceedings{wang2024localization,
  author = {Sujia Wang and Xiangwei Shen and Yansong Tang and Xin Dong and Wenjia Geng and Lei Chen},
  title = {{Localization-Aware Multi-Scale Representation Learning for Repetitive Action Counting}},
  booktitle = {VCIP},
  year = {2024},
  doi = {10.1109/vcip63160.2024.10849865},
}
Figure