Abstract
Temporal Action Segmentation (TAS) is a fundamental task in video understanding, requiring precise frame-level labeling in long, untrimmed videos. Traditional methods rely on dense frame-wise classification and multi-stage refinement, which are computationally expensive. We introduce BaFormer, a novel single-stage Transformer architecture that treats video segments as sparse "instance tokens." By combining instance queries with a global boundary-prediction query and a simple voting strategy, BaFormer achieves state-of-the-art accuracy while operating at a fraction of the computational cost—requiring only 6% of the inference time of current top-performing models.
Introduction
Temporal Action Segmentation (TAS) involves identifying and localizing action segments (e.g., "peeling a potato," "washing hands") within long video sequences. While recent deep learning models have significantly improved segmentation accuracy, they typically suffer from two major efficiency bottlenecks. First, they process videos frame-by-frame, leading to high computational redundancy. Second, they often require complex multi-stage refinement or post-processing (e.g., Viterbi decoding) to smooth out noisy, over-segmented predictions.
In this work, we propose BaFormer (Boundary-aware Transformer), which moves away from dense frame labeling toward a more efficient segment-based classification paradigm.
Methodology
BaFormer is designed as a single-stage architecture that decouples the identification of action boundaries from the classification of action types.
Sparse Instance Queries
Instead of labeling every frame, BaFormer uses a set of $M$ learnable instance queries. Each query learns to represent a specific action segment by predicting a temporal mask and a class label. This sparse representation allows the model to compress dense temporal information without losing fine-grained details.
Global Boundary Prediction and Voting
A dedicated global query aggregates video-wide context to predict class-agnostic action boundaries. These boundaries define a set of continuous segment proposals. To determine the final label for each proposal, we introduce Boundary-aware Query Voting. For every proposed segment, the instance queries "vote" based on their predicted masks; the query with the highest contribution determines the segment's final action label. This strategy is more robust than traditional frame-wise smoothing as it treats segments as integral units.
Experimental Evaluation
We evaluated BaFormer on three standard benchmarks: 50Salads, GTEA, and Breakfast. These datasets contain long-form videos of daily activities with varying temporal scales and action densities.
Results
BaFormer demonstrates a remarkable efficiency-to-accuracy ratio, significantly outperforming existing single-stage and multi-stage models.
Computational Efficiency
On the 50Salads dataset, BaFormer utilizes only ~6% of the running time and 10% of the FLOPs compared to the state-of-the-art DiffAct model. Compared to UVAST, another single-stage approach, BaFormer reduces inference time to 24% while delivering superior accuracy.
Segmentation Performance
Despite its efficiency, BaFormer achieves high accuracy. On 50Salads, it outperforms the ASFormer baseline by 3.9% in accuracy and 7.9% in F1@50 score. The voting mechanism effectively reduces over-segmentation errors, which are a common failure mode for frame-wise classification models.
Conclusion
BaFormer provides a highly efficient and accurate solution for Temporal Action Segmentation. By shifting from dense frame-wise processing to a sparse, boundary-aware query voting mechanism, it achieves state-of-the-art results with minimal computational overhead. Future research will focus on improving the class-agnostic boundary detection head, which remains the primary performance bottleneck.
Summary updated