Abstract
Temporal Action Segmentation (TAS) often suffers from "out-of-context" errors where deep learning models predict logically inconsistent action sequences. We present a neuro-symbolic framework that leverages formal grammars to refine neural network predictions. By introducing Key-Action-based Recursive Induction (KARI), we automatically learn probabilistic context-free grammars with recursive rules from action sequences. A Breadth-first Earley Parser (BEP) then filters noisy neural outputs to find the most grammatically plausible sequence. Our approach significantly improves performance on standard benchmarks like the Breakfast and 50 Salads datasets, demonstrating the power of combining deep learning with symbolic logical constraints.
Introduction
Temporal Action Segmentation (TAS) involves labeling every frame of a long, untrimmed video with a specific action, such as "cracking an egg" or "pouring milk" during a cooking activity. While modern deep learning architectures like Transformers and Temporal Convolutional Networks (TCNs) excel at recognizing local patterns, they often lack a global logical framework. This leads to out-of-context errors, such as predicting that a person "pours coffee" before "taking a cup," or hallucinating random actions due to video flickers.
Humans understand that activities follow a hierarchical "recipe." This research aims to provide AI with similar structural intuition by using formal grammars to "sanity-check" neural network predictions, effectively filtering out illogical sequences.
Methods
The proposed framework consists of a three-stage pipeline: activity grammar induction, parsing, and optimization.
KARI: Key-Action-based Recursive Induction
KARI is a novel algorithm designed to automatically learn a grammar from a dataset of action sequences. It centers on two main concepts:
- Key Actions: It identifies pivotal actions that appear consistently across sequences (e.g., "pour coffee" as an anchor for coffee-making).
- Recursion: Unlike previous rigid grammar methods, KARI introduces recursive rules. This allows the model to handle repetitive human behaviors, such as multiple spoonfuls of sugar or repeated stirring, without breaking the logical flow.
BEP: Breadth-first Earley Parser
To refine messy neural network outputs, the authors developed the Breadth-first Earley Parser (BEP). Standard parsers often struggle with recursive rules, leading to infinite loops or high complexity. BEP utilizes a Breadth-First Search strategy combined with pruning—retaining only the top $N$ most likely paths—to efficiently identify the most grammatically correct sequence from the neural model's initial prediction.
Optimization
Finally, a Viterbi-like optimization step aligns the grammatically refined sequence back to the original video frames, determining precise start and end times for each action segment.
Results and Discussion
The framework was evaluated on two major benchmarks: the Breakfast Dataset (1,712 videos) and 50 Salads (50 videos). By applying KARI refinement to state-of-the-art models like ASFormer and MS-TCN, the researchers observed significant improvements:
- Quantitative Gains: On the 50 Salads dataset, adding KARI to ASFormer improved the Edit Score (measuring sequence correctness) from 76.5 to 79.9.
- Error Correction: Qualitatively, the grammar successfully removed impossible hallucinated actions and inserted logically necessary actions that were visually obscured.
- Generalization: In synthetic tests, KARI achieved near-perfect recall (~0.98), indicating it successfully learned the underlying "rules" of activities even for unseen variations.
Limitations
The grammar acts as a refiner; therefore, it remains dependent on the base neural model. If the initial prediction is fundamentally incorrect (e.g., misidentifying the entire activity type), the grammar may not be able to recover the correct sequence. Additionally, inducing grammars for highly complex, multi-task activities remains an open challenge.
Conclusion
This work demonstrates a powerful neuro-symbolic synergy. By using neural networks as "noisy sensors" and formal grammars as "logical filters," the system maintains the feature-learning capabilities of deep learning while ensuring the reliability of symbolic logic. Future work may extend this approach to other sequential tasks such as robotics or procedural text analysis.
Summary updated