Abstract
This paper introduces a highly efficient, query-based approach to Temporal Repetition Counting (TRC) that slashes computational costs by over 94% while significantly improving accuracy. By moving away from traditional quadratic-complexity similarity matrices and using "Dynamic Action Queries," the model can count repetitive actions in an open-set manner—meaning it can count almost any repeating movement without needing to know the action class beforehand.
Introduction: The Challenge of Temporal Repetition Counting
Temporal Repetition Counting (TRC) involves determining the number of times a specific action, such as a bench press repetition or a jumping jack, occurs within a video sequence. This task is complicated by real-world factors including varying action speeds, sudden interruptions, and the "open-set" challenge, where the target action class is not known in advance.
Historically, state-of-the-art methods have relied on temporal similarity correlation matrices. This approach compares every frame to every other frame to identify periodic patterns. However, this results in a quadratic computational complexity ($O(T^2C)$), leading to excessive memory consumption and processing times for long video sequences, often resulting in "Out-of-Memory" errors on standard hardware.
Methodology: From Quadratic to Linear Complexity
The authors propose a novel framework inspired by the Detection Transformer (DETR) architecture, reframing repetition counting as a set prediction task. This shift allows the model to achieve linear complexity ($O(TC)$), making it significantly more scalable.
Dynamic Action Query (DAQ)
Unlike standard detection models that use fixed, learned queries, the DAQ adaptively initializes queries using features extracted directly from the input video. This content-dependent initialization enables the model to "look for" specific repetitions within a given clip, facilitating class-agnostic counting.
Inter-query Contrastive Learning (ICL)
To distinguish primary actions from background noise or irrelevant movements (like a person walking past), the framework employs Inter-query Contrastive Learning. This technique forces the model to cluster "repetitive action" queries together in the feature space while distancing them from "background/other" queries.
Transformer Encoder-Decoder
The system utilizes a Transformer to process video features and select the most informative queries. These queries are then decoded into specific temporal parameters, namely the midpoint and duration for each detected action cycle, which are then aggregated to produce the final count.
Experimental Setup and Datasets
The model was rigorously evaluated on two major benchmarks:
- RepCountA: The largest and most challenging TRC benchmark, featuring fitness videos with high variability in environment and cycle length.
- UCFRep: A subset of UCF101 used to assess the model's generalization capabilities on unseen actions, such as soccer juggling, without task-specific fine-tuning.
Key Results and Performance
The proposed method establishes a new state-of-the-art (SOTA) across multiple metrics:
- Accuracy: On RepCountA, the model outperformed the previous SOTA (TransRAC) by 26.5% in Off-By-One (OBO) accuracy and achieved a 22.7% reduction in Mean Absolute Error (MAE).
- Efficiency: The model achieved a 94.1% reduction in computational burden (FLOPs) compared to TransRAC. It can process 512-frame videos in just 0.78 seconds on a single V100 GPU.
- Generalization: The model successfully generalized to complex, unseen actions in the UCFRep dataset, significantly outperforming existing specialized TRC models.
Key Insights
- Counting as Detection: Framing repetition counting as the detection of individual temporal "objects" (cycles) is more effective than global signal analysis.
- Content-Dependent Flexibility: Allowing the video content to define the queries removes the bottleneck of fixed queries, enhancing performance in open-set scenarios.
- Scalability: Linear complexity is a critical feature, enabling the analysis of long-form video content that was previously computationally prohibitive.
Conclusion and Future Work
While highly effective, the model faces challenges with extreme camera angles that truncate motion features (e.g., missing legs in a jumping jack). Currently, the system assumes a single primary repetitive action per video; future work may involve extending the architecture to handle multiple overlapping or sequential action types. Additionally, improving robustness in extremely cluttered environments remains an area for further development.
Summary updated