Abstract
ASFormer is a Transformer-based architecture specifically designed for the action segmentation task in long, untrimmed videos. By incorporating local connectivity inductive biases through temporal convolutions and a hierarchical attention pattern, ASFormer overcomes the data-hungry nature and sequence-length limitations of vanilla Transformers. It achieves state-of-the-art results on standard benchmarks, demonstrating that Transformers can be effectively adapted for dense temporal prediction tasks.
Introduction
Action segmentation involves assigning an action label to every frame in a minutes-long, untrimmed video. While Transformers have revolutionized sequence-to-sequence tasks in NLP, applying them directly to action segmentation presents three major hurdles: a lack of inductive bias for small datasets, extreme sequence lengths (thousands of frames) that lead to quadratic complexity, and the need for iterative refinement to ensure temporal consistency across action segments.
The ASFormer Architecture
To adapt the Transformer for action segmentation, the authors propose ASFormer, which introduces three key architectural changes:
- Dilated Temporal Convolutions: Instead of using standard point-wise feed-forward networks (MLPs) inside the Transformer blocks, ASFormer uses dilated temporal convolutions. This injects a "local connectivity" inductive bias, helping the model learn efficiently from smaller datasets by explicitly modeling neighboring frames.
- Hierarchical Representation Pattern: To handle thousands of frames efficiently, ASFormer abandons global self-attention. Instead, it restricts attention to a local window. The size of this window and the dilation rate of the convolutions double at each successive layer, creating a local-to-global receptive field.
- Iterative Refinement Decoder: The authors design a custom decoder that uses cross-attention to refine the encoder's initial predictions. Crucially, the Query (Q) and Key (K) are formed by concatenating the encoder's output with the previous layer's output, but the Value (V) comes only from the previous layer to prevent the encoder from disturbing the refined feature space.
Key Insights and Ablations
The Impact of Positional Encoding
A surprising finding of this work is that standard absolute positional encoding (PE) actually degrades performance. Because ASFormer uses temporal convolutions, the network inherently captures relative positional information. Adding PE likely interferes with the convolutions' ability to learn effective feature embeddings.
Attention Mechanisms
- Single-Head vs. Multi-Head: Single-head attention performed just as well as multi-head attention. The authors hypothesize that the convolution operation naturally mimics the feature concatenation behavior of multi-head attention.
- Hierarchical Constraints: When hierarchical window constraints were removed (allowing global attention), performance plummeted. Without the forced local-to-global structure, attention weights became too uniform across thousands of frames, failing to focus on meaningful local actions.
Experimental Results
ASFormer achieved state-of-the-art performance across three standard public datasets using pre-extracted I3D features:
- 50Salads: Achieved an F1@10 score of 85.1%, an Edit score of 79.6%, and a frame-wise accuracy of 85.6%.
- GTEA: Achieved an F1@10 score of 90.1%, an Edit score of 84.6%, and an accuracy of 79.7%.
- Breakfast: Achieved an F1@10 score of 76.0%, an Edit score of 75.0%, and an accuracy of 73.5%.
Beyond accuracy, the hierarchical attention pattern reduces spatial complexity from $O(T^2)$ to $O(T)$, making the model highly scalable for long videos.
Conclusion
ASFormer demonstrates that with proper inductive biases and hierarchical structures, Transformers can be highly effective for long-form video tasks. While scaling the model beyond 9 blocks yields diminishing returns and increased memory costs, its modular nature allows it to serve as a powerful, drop-in alternative backbone for the broader video understanding community.
Summary updated