FIFA: Fast Inference Approximation for Action Segmentation

Yaser Souri, Yazan Abu Farha, Fabien Despinoy, Gianpiero Francesca, Juergen Gall

Abstract

Action segmentation is often hindered by the computational cost of sequential inference methods like Viterbi decoding. We present FIFA (Fast Inference Approximation), a novel approach that reformulates inference as a continuous optimization problem. By utilizing a differentiable energy function and "soft masks," FIFA enables gradient-based optimization of segment lengths. This method provides a 5x speedup over traditional Viterbi decoding while achieving state-of-the-art results on standard benchmarks and significantly improving temporal consistency in fully supervised models.

Introduction

Action segmentation involves assigning an action label to every frame in a video. A persistent challenge in this field is "over-segmentation," where frame-wise classifiers produce flickering predictions that lack temporal consistency. To address this, researchers typically employ an inference stage—such as Viterbi decoding—to find the most likely sequence of actions and durations based on a grammar and expected action lengths.

However, Viterbi decoding is a significant computational bottleneck. It is inherently sequential, scales poorly with video length, and is difficult to parallelize on modern hardware. FIFA addresses these limitations by replacing discrete search with continuous optimization, offering a fast, parallelizable, and "anytime" inference method.

The FIFA Framework

The core innovation of FIFA is treating inference as a continuous optimization problem. Instead of searching through a discrete state space, FIFA minimizes a differentiable energy function $E$ composed of two primary terms:

  1. Observation Energy ($E_o$): This term measures the alignment between segment labels and the frame-wise probabilities generated by a neural network.
  2. Length Energy ($E_l$): This term penalizes segments that deviate from the expected average duration of a given action. The authors found that a Laplace distribution (linear penalty) outperforms a Gaussian distribution (quadratic penalty), as the latter often traps the optimizer in local minima.
Overview of the FIFA inference process: Segment lengths are iteratively updated by minimizing a differentiable energy function composed of length and observation terms.

The "Soft Mask" Trick

To make the observation energy differentiable, FIFA employs a smooth, plateau-shaped parametric function to create "soft masks" for each action segment. These masks are defined by a center and a width derived from segment lengths. Because this formulation is smooth, gradients can flow through the masks, allowing segment lengths to be updated via standard optimizers like Adam or SGD.

Optimization and Parallelization

Unlike Viterbi, which must process frames sequentially, FIFA’s mask generation and energy calculations are element-wise operations that can be fully offloaded to a GPU. This allows for massive parallelization. Furthermore, FIFA is an "anytime" algorithm; it can be stopped after a few iterations (e.g., 5 or 10 steps) to provide a rapid estimate, or run longer for higher precision.

Experimental Results

The authors evaluated FIFA on two standard benchmarks: the Breakfast Dataset (cooking activities) and the Hollywood Extended Dataset (movie clips).

  • Efficiency: FIFA is at least 5x faster than exact Viterbi decoding on the MuCon framework and up to 12x faster on the CDFL framework. It typically achieves optimal results in just 50 optimization steps.
  • Accuracy: On the weakly supervised Breakfast dataset, FIFA achieved a Mean over Frames (MoF) of 51.3%, surpassing previous state-of-the-art methods.
  • Refining Full Supervision: While many fully supervised models (like MS-TCN) skip inference, applying FIFA as a post-processing step boosted the F1@10 score from 52.6 to 75.5, demonstrating its effectiveness in enforcing temporal smoothness.

Conclusion and Future Work

FIFA demonstrates that continuous relaxation of discrete inference problems can yield significant gains in both speed and accuracy for action segmentation. While the current implementation performs best when the action transcript is known, its differentiable nature opens the door for future "end-to-end" training, where the inference energy itself could serve as a loss function during the training of the underlying frame-wise classifier.

Summary updated

BibTeX
@inproceedings{souri2021fifa,
  author = {Yaser Souri and Yazan Abu Farha and Fabien Despinoy and Gianpiero Francesca and Juergen Gall},
  title = {{FIFA: Fast Inference Approximation for Action Segmentation}},
  booktitle = {GCPR},
  year = {2021},
  doi = {10.1007/978-3-030-92659-5\_18},
}
Figure